DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13233>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13233

html:option needs a "styleId" attribute

           Summary: html:option needs a "styleId" attribute
           Product: Struts
           Version: Nightly Build
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Custom Tags
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The <html:option> tag does not implement a "styleId" attribute, either in the
code or the TLD.  This tag generates an HTML "option" element, which according
to the 4.01 spec, allows an "id" attribute, which the "styleId" attribute
normally generates (Go to <http://www.w3.org/TR/html401/index/attributes.html>
and page down to see "id" in the table).

In contrast, the other two tags which generate "option" elements, the
"optionsCollection" and "options" tags, also do not have "styleId" attributes,
but it would be impractical to add this support.  This is because the "styleId"
attribute only specifies a single value, but these two tags generate multiple
"option" elements (usually), and the value of all "id" attributes in a document
have to be unique (see
<http://www.w3.org/TR/html401/struct/global.html#adef-id>).  It might be
possible to somehow specify a collection object to hold the "id" values, but I
don't see much value in that.  What WOULD have value, however, is adding a
comment to the appropriate method in each of these two tag classes saying WHY
the "styleId" attribute is omitted, for the benefit of the next person to wonder
about this omission.

On the other hand, we don't have this obstruction with the "option" element, and
we should try to support all the legal attributes of the HTML 4.01 spec, if we can.

Technically, I should add a patch attachment, but the change is very small.  The
solution is to change "OptionTag.doEndTag()" to add the following block between
the similar blocks for "style" and "styleClass", along with adding the member
variable and the accessor and setter:

        if (styleId != null) {
            results.append(" id=\"");
            results.append(styleId);
            results.append("\"");
        }

Along with this, the "ELOptionTag.evaluateExpressions()" method in the Struts-EL
library should be changed to uncomment the check for "styleId".

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to