Workaround for "withdraw" attribute problem

Answered by: Keith Berard and Tung Fu (PTC) Last Updated: 2006-08-06

=Problem=

When the "withdraw" attribute is set on an XUI control, this is supposed to prevent the display also of the controls children. However, sometimes children tabboxes fail to withdraw completely.

=Workaround=

public void enable(boolean enable) { if (enable) { this.rootBox.setAttribute("withdraw","false"); }        else { XUIHelper.setChildTabboxWithdraw(this.rootBox, enable); this.rootBox.setAttribute("withdraw","true"); XUIHelper.setChildTabboxWithdraw (this.rootBox, !enable); }    }

... and in the class XUIHelper:

public static void setChildTabboxWithdraw(Element rootNode, boolean enable) { String wdString = "false"; if (!enable) { wdString = "true"; }         if (rootNode.hasChildNodes) { NodeList childNodes = rootNode.getChildNodes; for(int i=0; i<childNodes.getLength ; i++) { Node curChild = childNodes.item(i); if (curChild.getNodeType == Node.ELEMENT_NODE) { setChildTabboxWithdraw((Element)curChild, enable); }             }          }          String nodeName = rootNode.getNodeName; if (nodeName.equals("tabbox")) { rootNode.setAttribute ("withdraw",wdString); }     }