HiOur DCT has an 'inline' subelement that invokes a script to read a config file and generate form field on the fly. I want to control the visibility of these 'dynamic' form fields, but the 'IWDatacapture.getItem()' doesn't seem to get hold of these fields. It always returns null, while it works perfectly fine for other fields on the form.Has anyone encountered this issue? Any suggested solutions will be greatly appreciated.Regards,Rajit____________________TS 672 on Windows 2k3
var speccontainer = IWDatacapture.getItem("/prod_details/spec_tab/specifications_container");
Hi Faizi,Thanks for your response. Here is some more information:[...]The JS variable 'speccontainer' seen above, always ends up as 'null'. So basically the 'Item' object for an element created using an inline script is turning out to be null.I hope this gives you an idea.Thanks in advance for your inputs.RajitPS: One more observation, I am able to register the 'onItemChange' event on another field that is also generated by the inline script. But when I try to get the 'Item' object for the same element using 'getItem()', I get null.
<container name='spec_tab'> <item name='prod_line'>...</item> <container name='specifications_container'> <container name="set0"> <container name="spec_container0"> <item name="specval1">...</item> </container> </container> </container></container>
init()
Hi Ghoti and Frederik,Thanks for your responses.Yes, it is an 'iwov' style DCT.xpath is correct, the whole structure was not shown for brevity. Only the affecting container is shown.Here is the script section of the DCT:In my initial attempts, the script-generated elements were in invisible state when the form loaded. On facing the issue, I also tried keeping the containers visible. Yet, the getItem() doesn't seem to reach the 'inline' script-generated elements.Even the 'getChildren()' function run on the 'spec_tab' container (that encloses the inline statement) also gives only one child, which is the 'label'. It completely ignores the remaining containers(that are generated by the script) under the same parent.Your thoughts and help on this issue is appreciated.Thanks,Rajit
Hi ISCBorisB,The typo was only in the post here, the actual code is consistent.Anyways, the primary problem is with getting the 'specifications_container' item.Thanks!Rajit
While your inline call appears to be working, the datacapture6.0.dtd does not allow inline at the location you are using it. This would indicate to me that possibly other Forms Publisher features may not work correctly either.