struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17592] - optionsCollection requires property while only name required?
Date Mon, 03 Mar 2003 16:35:43 GMT
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=17592>.
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=17592

optionsCollection requires property while only name required?





------- Additional Comments From hhvdmeer@eniac.nl  2003-03-03 16:35 -------
OptionsCollectionTag.java uses the RequestUtils.lookup method to retrieve the 
collection. This method returns the bean specified by the name attribute if the 
property attribute is empty / null. Since there are no other references in 
OptionsCollectionTag.java to the property attribute, functionality of 
retrieving the collection relies fully in RequestUtils.java, which supports 
retrieving beans/objects from request-scope with only the name attribute 
specified. 

I've changed the .tld file locally and the tag works perfectly. Fixing this 
would eliminate the need for the following JSP-code if the collection is not a 
property of another bean/object:

<html:select property="value">
  <logic:iterate name="collection" id="element" type="DynaBean">
    <html:option value='<%= element.get("value").toString() %>'>
      <bean:write name="element" property="label"/>
    </html:option>
  </logic:iterate>
</html:select>

and can be replaced with:

<html:select property="value">
  <html:optionsCollection name="collection" label="label" value="value"/>
</html:select>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Mime
View raw message