XHTMLOptionElement.SetSelected() incorrect
Petr Stehlik <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.xmlc,gmane.comp.java.enhydra.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Enhydra 5.0 source. File
modules/xHTML/src/org/enhydra/xml/xhtml/dom/xerces/XHTMLOptionElementImpl.java
public void setSelected (boolean newValue) {
setAttribute("selected", newValue);
}
This is IMHO incorrect. The XHTML uses 'selected="selected"' so the code
should be as follows:
if (newValue)
setAttribute("selected", "selected");
else
removeAttribute("selected");
Can somebody comment this? Please note that there are many such
attributes, not just 'selected', but I found it on this one (since
pre-selection of OPTION in SELECT stopped working in my app after
converting from HTML to XHTML).
Petr