/** * See if the dropdown already has a group of that name, else create it * * @param select the select element * @param name the name of the group * @return the optgroup or null */ HTMLOptGroup getGroup(Element select, String name) { for (int i = 0; i < select.numChildren(); i++) { try { Element e = select.getChild(i); if (e instanceof HTMLOptGroup) { String label = e.getAttribute(HTMLNames.LABEL); if (label != null && label.equals(name)) return (HTMLOptGroup) e; } } catch (AeseException he) { System.out.println(he.getMessage()); } } return null; }