On editing of the DCR, depending upon certain field values we need to disable the access of other fields. Also have to put some values in fields after fetching it from DB. For this we have to call a script using callserver.What are the best possible ways of doing the same? Is there any event or pre-defined function like onLoad or onFormLoad?
There is (undocumented) flag, parent.datacapture.isDatacaptureLoaded
What is the advantage of this flag over onFormInit?FormAPI Developers Guide:"To ensure that FormAPI operations (perhaps tomake a container invisible) occur after initialization is complete, FormAPI provides a formevent OnFormInit to defer execution of user script code."
What is the advantage of this flag over onFormInit?
...however as of now i have put a delay in between two callservers. I hope there would be no performance issue on that?
//Set Global Variables...IWEventRegistry.addFormHandler("onFormInit", init);//--------------------------------------------------------------------------------// Init Section//--------------------------------------------------------------------------------function init() { // Load Validation may seem a bit paranoid upon Init Event. // Still, "Initiated" and "Loaded" are not always synonyms in TS. if (parent.datacapture.isDatacaptureLoaded) { custom_init(); } else { setTimeout("init()", 500); }}//--------------------------------------------------------------------------------function custom_init() { // Place your "real" Init here}//--------------------------------------------------------------------------------// GUI Section//--------------------------------------------------------------------------------...
I always put a delay on my init. Performance impact is minimal. Granted, that may be paranoja from 5.x time, but I do not think so. The following is the snippet from my personal *FormAPI Best practice* (and to anybody ready to start throwing tomatoes I did say Personal, didn't I?)
REALLY APPRECIATED!! THANKS A MILLION.Still i wonder, why IWOV does not adds on an extra event for onFormLoad??
IWEventRegistry.addFormHandler("onFormInit", init);top._dcWin.IWDCEventRegistry.addListener("onFormLoad", loader);function loader(){alert("loading");}function init(){alert("init");}
But I still do not not get the point...