TeamSite 6.7.1 Sp1 patch 1Windows 2003If the onFormInit event is on the Tagging GUI page then the onFormInit function doen't get ran about 1 in every 50 times the Tagging GUI is opened/refreshed. Example:[HTML] <script><br> IWEventRegistry.addFormHandler("onFormInit", init);<br> <br> function init(){<br> var virtualPath = IWDatacapture.getItem("/metadata/DCR/virtualPath"); <br> vpathprod.setReadOnly(true);<br> }<br></script>[/HTML] If the onFormInit event is included from a separate location the onFormInit function doesn't get ran about 1 in every 10 times the Tagging GUI is opened/refreshed.Example:[HTML]<script src="/iw-mount/default/main/administration/WORKAREA/administration/javascript/tag.js" language="javascript" type="text/javascript" location="webserver"/>[/HTML] There are no errors returned and FormAPI works fine after the page loads. I can even call the init function from the click of a button.Can anyone else recreate this?This doesn't happen on the DCT, just the new Tagging GUI.
The code you posted is erroneous since you define a var called virtualPath and then dereference an undeclared variable called vpathprod.However, assuming that is just a typo in the forum posting - I'd suggest you contact Support and open a case with them (provide them as simple a MDC / DCT with FormAPI code as you can to facilitate their being able to reproduce the problem in-house)
Delay init a little. Like that (it's a hack though)
since onInitEvent gets missed...
In my experience onInit Event is never missed. It just fires too soon. "Form initiated" and "Form Loaded" are two different things in TS. Chances are, your getItem fails onInit simply because an item is not there yet, I saw that many times.
IWEventRegistry.addFormHandler("onFormInit", initFields);