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)
Hiding form elements based on TPL choice
anew
Hello,
We'd like to hide/unhide elements of a form using formAPI based on which presentation template is selected in the Form Settings Dialog box.
Is there a listener that can trigger a function when the TPL is set from the Form Settings Dialog box?
Thanks
Find more posts tagged with
Comments
nipper
Yes you can do this ( though not the way you asked - with a callserver or some creative scripting on startup)
Something like an inline that runs on startup of the DCT, reads the EA for the TPL used and sets a specific field to the TPL type, then FormAPI can read that and you are good to go. This will only work on an existing DCR and not a new one. Why ? Because the TPL type is not decided until after the save happens.
IMHO, you would be better served by having a selection in the DCR that tells the output type (one select for each TPL type), and then letting formapi do it's job.
The TPL would then be more complex because it would need to do some logic to make certain the proper look is generated.
birtViewer.jpg
anew
I am appreciating your response
But, All of what you mentioned seems to be available without using a callserver using IWPageGeneration.getPresentationTemplate().getName();
Given that, the issue for me is not when a page is edited, but if the user chooses a different TPL in the Form Settings while the DCT is being previewed or generated. I need a listner event to fire when the Form Settings are reset in the DCT. Then I will be able to hide and unhide elements based on which TPL is chosen from the Form Settings.
Is there such an event, official or unofficial?
Thanks
Attendance.rptdesign
ISCBorisB
Is there such an event, official or unofficial?
There is no event. If you need it badly enough you can perhaps hack iwhome/httpd/webapps/content_center/formspub/datacapture_settings.jsp,
handlePTClick and/or handleClickOk methods.