When are you running initDCR ? OnFormInit ?
I have nested containers grps -container grp- subcontainer search_items - container linked_item - subcontainer auth -containerI need to to hide the auth container and I tried like this...but not working...can anyone see this and let me know what is wrongfunction initDCR() {//Make auth container hidden var AuthContainer = IWDatacapture.getItem("/doc/grps/grp/search_items/linked_item/auth"); if (AuthContainer){ AuthContainer.setVisible(false); } }
grps -container grp- subcontainer search_items - container linked_item - subcontainer auth -container
function initDCR() {//Make auth container hidden var AuthContainer = IWDatacapture.getItem("/doc/grps/grp/search_items/linked_item/auth"); if (AuthContainer){ AuthContainer.setVisible(false); } }
The highlighted line is likely the problem.Are these "containers" or "replicant containers" - if they're replicants you must iterate through the various children at each level to get to the specific container in each "tree" that you want to hide.Alternatively - if you set an eventHandler for it - (in which case you can use the path you have specified there) the handler function will be passed the specific item that triggered it, making it trivial to act on it.
Sorry for my ignorance but I am confused. If you want to hide the container on formInit .. why dont you just specify it as hidden in your DCT xml itself. You can then try and make it visible when required.
you mean in datacapture.cfg? how