logo       

XHTMLOptionElement.SetSelected() incorrect: msg#00062

java.enhydra.xmlc

Subject: XHTMLOptionElement.SetSelected() incorrect

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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise