Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Enforce generated file name using FormAPI
semaphore
Is it possible to automatically save a generated file using system generated file name when user clicks on the Generate button? I am using TeamSite 5.5.
Is there an event for Generate button click?
Thanks for your help!
Find more posts tagged with
Comments
Jens
There is an event for GENERATE Button (onSave).
See FromAPI-Docs:
http://hah/iw/help/tst/formapi/formapi_30.html#SEC30
Ex.:
function onSave(btn) {
switch(btn){
case IWDatacapture.SAVE_BUTTON:
case IWDatacapture.SAVECLOSE_BUTTON:
case IWDatacapture.SAVEAS_BUTTON:
case IWDatacapture.GENERATE_BUTTON:
// alert("Sorry!\nYou cannot generate JSPs. The files were build automatically.");
//return false;
default:
}
Migrateduser
In response to the original question, unfortunately, there is no generate click event.
This method only gives you a way to tell if a save DCR event was generated through the click of the generate button or not. You can prevent the user from saving a DCR and generating, but at this point in the flow, the generate filename has not been given yet. If the user had saved the DCR before clicking on generate, this event would not fire. (There is currently also no way to specify a path for the output file of the generate...)
semaphore
Thanks for your response.
I solved the problem by first saving a DCR with system generated name (using FormAPI) and then generating resulting file from within PT using <iw_ostream> with the file name borrowed from DCR.
pawanjit
Can you please post more details on methodology used here? I am familiar with o_stream tags. However, when the user clicks on generate button, the template prompts the user to enter generated file name. What are you doing with that value?
Migrateduser
If you don't mind regenerating the page on every save you can use callServer onSaveDone to execute a CGI or JSP on the server - pass it the DCR path. Then you can remove or disable the generate button.
ObjectService.java