Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Solution : Disabling buttons on templating interfa
brianaragno
Hi All,
I saw lots of discussion about disabling the preview and generate buttons on templates. I have this same need and could not find a solution that I liked so I came up with my own. I used the FormAPI to do it. I'm attaching the script I wrote. Just open it up and edit the true false values for each of the buttons and then call it from your dct.
Hope this helps,
Brian
Find more posts tagged with
Comments
Johnny
Interesting hack.
And I didnt even need to modify any product files.
Nice work.!
John Cuiuli
Consultant
Sydney, Australia
START.ARG_and_more.txt
sunil_j
Hi,
Good Work dude !!! I liked your approach. It was fantastic.
Can you tell me if it is possible to handle the click event of + symbol for a replicant, using FormAPI?
For example, inside a replicant I have 2 textboxes, I wish to make one textbox invisible everytime I click on the + symbol. Let me know if thats Possible?
Regards
Sunil
Jeremy
Solaris, TS552
Hi,
Seems like you've come up with a fantastic solution here! I just wish I could get it to work!!
I have done exactly like you said - put the .js in the correct place, edited my datacapture.cfg to include the file.
I then also added a couple of alerts in the .js to make sure it was working, and these show up fine.
I checked to see what values were being thrown out and it seems that for me the script will go no further than the beginning of the handleButtons function.
It seems to fail on this line
if (buttonFrame.location.href.indexOf("buttonframe.jsp")>-1){
I alert the value of this on the line before and it is returning a
-1
.
alert("In handleButtons function : "+buttonFrame.location.href.indexOf("buttonframe.jsp"));
You wouldn't happen to know why this is happening for me, when it is clearly working for others?
It would be great if we could get this working - I don't think anyone ever thought of trying it this way.
Thanks,
Jeremy
brianaragno
Hi Jeremey,
Try doing an alert on buttonFrame.location.href This will most likely be blank.html . If so, at the bottom of the script you'll find this line:
setTimeout("handleButtons()",10);
Try increasing the 10 to something like 300. This is the number of miliseconds that are allowed to pass before the script is executed. Since the frame that shows the buttons initially loads blank, I can't access the buttons until after the redirect to the jsp page is made. The timeout of 10 worked for me, but there are a number of factors that could impact this for you. My guess is that increasing this value will fix the problem for you.
-Brian
brianaragno
Hi Sunil,
Thanks for the praise. Interestingly enough, I was in a meeting yesterday and one of our clients asked the same question. They want the text boxes in replicants to "roll-up" when they are not active.
I'm a firm believer that anything is possible, I just have to code it. If the project moves forward, I'll be writing some code to do this and I'll be sure to post it here when I'm done.
At this point, I'm thinking that I could capture the onClick or onMouseUp event and see if it was called from the + button - ico_insert.gif If so, then I could hide the items that corespond to it. I'm guessing that I could access these items using an array index equal to that of the button, but I'm just speculating at this point.
If you make any progress with this, please share with the group.
Thanks,
-Brian
Jeremy
Hey Brain,
Thanks - I was using 100 at the time and thought that would have been more than enough - apparently not! Have set it to around 4000 and it finally started working! Yes...thats right! Four Thousand. I wonder why it needs such a larger value on my system? Oh well. It works now!
Thanks very much and fantastic work!
Jeremy
brianaragno
You're welcome Jeremy. I'm glad to hear that it is working for you now. Wonder why you had to increase that to such a high value? Is your client machine older or slower? 4 seconds seems like a really long time for the browser to render the template.
-Brian
gzevin
I had to set up the delay to 1000.. and then it worked. In any case, the response is quite acceptable
Greg Zevin
Independent Interwoven Consultant/Architect
Sydney, AU
littlelise
Hi,
we changed the ButtonDisabler.js a little to do a try catch on the initial load of the page, since we were having problems with the buttons showing up for a short period of time and then closing down to the two we wanted to show.
I've attached the updated file if anyone is interested, or has had a similar experience.
Regards,
Lisa