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)
generating a Page
er_anant
Hi All,
I want a functionality that when a user clicks on "generate" on DCR it should automatically generate the page with the same name as of DCR.
How can I achive it. The "onGenerate" event of form API is not working on DCR...
regards
Kumar
Find more posts tagged with
Comments
TheYann
The event names are
case sensitive
and
O
nGenerate has a
capital O
.
Now as far as the filename, I thought it would be exactly the same file name with the extension defined in the templating.cfg, but I'm not sure as we've not been using presentation templates here!
But if you get the event working I'm sure you'll be able to set that name to whatever you feel like!
er_anant
thanks for your interest yann...
I am using this code...
IWEventRegistry.addFormHandler("OnGenerate",handle_generate);
function handle_generate()
{
alert('hi');
}
and it works fine on a new form entry....but when I open a dcr and the click on generate it does not give me any alert.
Do I need to call some other event?
TheYann
if when you say "open" you mean in preview mode, it's totally normal as javascript and FormAPI is turned off.
On the other hand if you mean edit, then it seems to me there's another problem some other place. Javascript is very touchy-feely, if you do something it doesn't like, it will throw an exception and nothing else from that point out will be available ... unless you have try/catch blocks.
So first make sure that when you "open" the DCR it's not in preview mode in order for the Javascript to be enabled.
Then when you edit and it still doesn't work, I'd suggest you check for javascript errors and debug the code if there is any because there's no reasons why that even wouldn't work in edit mode!
er_anant
thanks yann...I was not aware of this fact that in preview mode javascript is disabled.
TheYann
Not a problem, now you know
Unfortunatly I don't think it's meant to be turned on during the preview mode so you'll have to go through edit mode to do what you want to do!
Or another option is to create a custom generate item in one of the menu or something of the sort ...
er_anant
ok...sounds good ...but how can we add one more Item to menu ?
TheYann
It best you look in the Interwoven User Interface Customization Guide (uicg.XXXX.cg.pdf where **** is your version of TS) for that, I haven't done it myself and I don't want to mislead you, I just know it's possible as we do have custom made menu items here.
Good luck!