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)
how to Close window generated by iwgenerate
Aghosh
Hi All,
We have a requirment which is as follows :
if cms id is not generated , xml should not generate (iwgenerate should stop)
Right now we have cms id , which is basically a unique value , which is generated through call server.
Now the issue is that cms id is generated when the user clicks on generate button.On pressing the generate button the following happens :
Even is triggere :
IWEventRegistry.addFormHandler("OnGenerate",handleNameDCR);
which calls : function handleNameDCR()
This function has code for saving and regenrating the page , as the dcr is new after this function function handle_savedone() is called which is callin an call server and returning a cms id
Now the problem is that the callserver returns back value after we have done return true in handleNameDCR function which is basically triggered on pressing generate.
due to this i am not able to validate if the cms id is generated and make the handleNameDCR function return true or false according to return value of the call server for cms id .
Is there any way i can check the value which the callserver has returned before the control go to the handleNameDCR function which is triggered on pressing generate where i am setting the return value as true or false.
Second option :
Can i close the window which pops up after iwgenerate is completed(basically generated xml )
Regards,
Abhishek
Find more posts tagged with
Comments
Rick Poulin
The problem with callserver is that it's asynchronous. Thus, your handleNameDCR() would always have to return false, and let the output of your script continue the page flow, say by calling IWDatacapture.generate(). Unfortunately for you, there is no such function. I suggest instead that you assign an ID onFormInit so that it's already there by the time your user calls the generate function.
Can i close the window which pops up after iwgenerate is completed(basically generated xml )
Nope. The answer would be different if you were generating HTML, where you could print an ugly JS function that only operates when you want it to. With a format like XML, you can't do that from within the window, and you don't have the popup window handle from your opening frame.