You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Michael McGrady <mi...@michaelmcgrady.com> on 2004/07/15 00:27:14 UTC

LabelValueBean and BeanMap with and for indexed properties

I am using my version of a BeanMap built for instrumentation, cf. 
http://wiki.apache.org/struts/StrutsCatalogMappedBeans, and am putting a 
series of java.util.LinkedLists holding 
org.apache.struts.util.LabelValueBeans into the BeanMap via 
setProperty(Object key,Object value).  I am then accessing the lists via 
<logic:iterator> in Struts radio tags (where "eclipse" is a key in the 
BeanMap holding a list of LabelValueBeans) as follows:


               <logic:iterate id="row" name="layouts_schemes" 
property="eclipse">
                 <html:radio property="scheme" value="value" idName="row"/>
                 <bean:write name="row" property="label"/>
               </logic:iterate>

This works great!  However, I am not sure that this behavior will be 
guaranteed in the future, since it is not documented in the docs.

In the docs, the property for iterator is "defined" as the

   	"Name of the property, of the JSP bean specified by name, whose getter 
returns the collection to be iterated".

Obviously, my code sneaks in the value of the property attribute as the

	"Name of the key in the BeanMap which returns the Collection saved is 
scope as "layouts_schemes"

Trust me, if I change the property value to a different key in the BeanMap, 
I do get a different collection (List) from the BeanMap on the page.  My 
question is whether this will be guaranteed in the future. Or, is this an 
anomaly that I cannot count on in the future?  Anyone have an inkling on that?

Thanks!

Michael



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