Home
TeamSite
Customizing the Data Capture Form
mvaidhya
Hi, Is it possible to remove/disable some of the buttons on the Teamsite Templating Data Capture form? For example, I would like to remove/disable the "Save" button and the "Generate" button on the data capture forms.
Thanks!
Find more posts tagged with
Comments
Migrateduser
Check out FormAPI. I believe it has the ability to either hide these buttons or change the way they function:
https://support.interwoven.com/kb/kb_show_article2.asp?ArticleID=48964
mvaidhya
Thank you for your response.
We can use "setVisible(boolean)" method to make an item visible/invisible. The problem that I have is , I don't have the names of the buttons. Looks like the buttons are images and they don't have a name. I need to know the name of the item to make it visible/invisible. Is there any other way to access them or modify the buttons themselves.
Has anyone done something similar?
Migrateduser
I don't think that you can remove the buttons themselves, but this section talks about how you can have these buttons trigger javascript (and perhaps prevent that operation from taking place if you do not want it to):
https://support.interwoven.com/library/manuals/templating/html/formapi1.0/formapi_18.html#SEC18
There is also a Feature Request entered to allow for the disabling of the buttons themselves. If you really need this you can open a support case and ask that it be attached to FR 34449 (keep in mind that a Feature Request is just a request and no assurance that the feature will be added in a future release).
akshathp
The changes that you are planning to make would be very much unsupported. That would mean any next upgrade of your machine and you loose all your customization.
However, for a test machine I once made some changes in datacapture_buttonframe.jsp that is in my
"iw-home/httpd/webapps/webdesk/templating" folder.
Since it was a test machine I could afford to make such modifications but am sure in one way or other it might affect some components.
Good luck!
Akshat Pramod Sharma
Interwoven Inc.
mvaidhya
Thank you Akshat and nacks for your response.
Since it is only a desired feature and not a "must-have" , it should be fine.
mvaidhya
Hi, I tried modifying the datacapture_buttonframe.jsp on our test server. I couldn't see the changes on my datacapture form. I just added simple html before the buttons on the jsp file. Do I have to do anything else other than just modifying the file? Am I missing something?
Thank you!
Migrateduser
Do you REALY need to hide them?
You could try this:
function saveHandler(button)
{
switch (button) {
case IWDatacapture.SAVE_BUTTON:
// User clicked 'Save', 'Save As' or 'Save and Close'
setModifiedBy();
handleNameDCR();
return true;
//case IWDatacapture.SAVEAS_BUTTON:
//case IWDatacapture.SAVECLOSE_BUTTON:
//case IWDatacapture.PREVIEW_BUTTON:
//case IWDatacapture.GENERATE_BUTTON: - User clicked 'Preview' or 'Generate'
}
And based on user ROLE you return TRUE or FALSE. You could also display an error message. When you return FALSE the save process is canceled.
Paulo Gouveia
Royal Caribbean and Celebrity Cruises
Information Tecnology
mvaidhya
Thank you for the response. I really do not need to hide them but I just wanted to try it by modifying the datacapture_buttonframe.jsp - just in case if we decide on that option.
Also, I tried modifying the saveHandler as you mentioned.
Here is what I added to my datacapture.cfg file:
function saveHandler(button)
{
switch (button)
{
case IWDatacapture.GENERATE_BUTTON:
alert( "Button invalidated" );
return false;
case IWDatacapture.SAVEAS_BUTTON:
alert( "Button invalidated" );
return false;
case IWDatacapture.SAVE_BUTTON:
case IWDatacapture.SAVECLOSE_BUTTON:
case IWDatacapture.PREVIEW_BUTTON:
return true;
}
I am still able to Generate / Save As even though I am returning false when those buttons are clicked. I don't see the alert. Does this function need to be added elsewhere? Or am I missing something?
Migrateduser
Did you register the event?
Like this:
IWEventRegistry.addFormHandler("onSave", saveHandler);
Paulo Gouveia
Royal Caribbean and Celebrity Cruises
Information Tecnology
mvaidhya
Thank you again.
Yes, I had not registered the event. I am trying to deactivate the "Save As" and the "Generate" button. Now after the changes , adding the SaveHandler function and the registering the onSave event, I am able to deactivate the "Save As" button. But the "Generate" button works as usual - it not being deactivated. My understanding is that clicking the "Generate" button also generates the "onSave" event in which case it should be deactivated similar to the "Save As" button. But it is not happening in my case. Do you know why that would be happening??
Gregg Faus
I've had success disabling both the Save As and Generate button. The Generate button can only be disabled by some JSP editing, while the Save As button can be done directly with FormAPI.
See my post here for instructions:
http://devnet.interwoven.com/forums/cgi-bin/showthreaded.pl?Cat=&Board=PRODUCTS_TEMPLATING&Number=2392
mvaidhya
Thank you. This should solve my problem.
Migrateduser
mvaidhya,
Using formAPI the only thing you can do with the buttons is the code bellow. But I just tested it and once you save the DCR, TST seams to ignore this function.
function saveHandler(button)
{
switch (button) {
case IWDatacapture.SAVE_BUTTON:
// User clicked 'Save', 'Save As' or 'Save and Close'
return true;
//case IWDatacapture.SAVEAS_BUTTON:
//case IWDatacapture.SAVECLOSE_BUTTON:
//case IWDatacapture.PREVIEW_BUTTON:
case IWDatacapture.GENERATE_BUTTON: // User clicked 'Preview' or 'Generate'
alert("are you trying to generate?");
return false;
}
}
Paulo Gouveia
Royal Caribbean and Celebrity Cruises
Information Tecnology
Edited by Paulo on 01/06/03 02:16 PM (server time).
pawlr
Do we have official confirmation from Interwoven that the FormAPI documentation (sec. 2.4.2) is wrong or unsupported in 5.5.2?
Gregg Faus
I think the documentation is fairly clear when it states that the different events that are caught ONLY apply to the save process. So when the DCR is already saved, none of those events will be fired. That is why I had to do some custom JSP code.
- gf
pawlr
Look at the blue box below the flowchart.. it clearly indicates that on the onSave action, 2 cases are returned for PREVIEW and GENERATE.. based on earlier posts it appears that this is non-functional in 5.5.2, making the documentation, ahem, wrong.
My question to Interwoven.. will this be fixed in a patch soon, or is a fix anticipated for the next release?