OK, so I am lazy and am reusing code for certain tasks (FormAPI), in once case, if someone uses select list A, I want to hide list B. However this code is used by multiple DCTs, some of which do not have list B.So if I just try to hide B (and it is not there) I will get a JS error.My thought is to getRootItems and, if B is there, then hide it. I was wondering if there is a better way to handle this, basically a way to see if the item (by name) exists.Andy
var item = IWDatacapture.getItem("/my/item/name");if (item && item.setVisible) { // I'm a bit paranoiak I admit /* your code here */ item.setVisible (/* the other list exists ? */);}