You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by C F <ta...@yahoo.com> on 2003/07/25 18:45:57 UTC

Help referencing collections for HTML taglib

Hello,
I figure examples are worth a thousand words.  So I'll
try to keep this simple... can anyone show me (if
possible) how to accomplish the same thing as in the
examples but using just <html-el:select> and
<html-el:options> tags.... without <c:set>??  I'm
using Struts 1.1.


Example 1
------------
<c:set var="var1"
value="${requestScope.bean1.bean2.collection1}"/>
<html-el:select property="prop1">
	<html-el:options collection="var1" property="valprop"
labelProperty="labelprop" />
</html-el:select>

This works great... but it seems like I should be able
to do something along the lines of....


<html-el:select property="formprop">
	<html-el:options
collection="${requestScope.bean1.bean2.collection1}"
property="valprop" labelProperty="labelprop" />
</html-el:select>

... which doesn't work because the interpreter
evaluates the collection1 into a string before being
processed by the Struts tag libs.  Bottom line is I
want to be able to get rid of that <c:set/> tag if
possible.


Example 2 (using hash table)
-----------------------------
<c:set var="var2"
value='${requestScope.myHashMap["key1"]}'/>
<html-el:select property="formprop">
	<html-el:options collection="var2" property="valprop"
labelProperty="labelprop" />
</html-el:select>



Thanks!



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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