You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marco Mistroni <mm...@waersystems.com> on 2003/12/15 14:00:14 UTC
html:select tag or logic:iterate
Hi all,
I am quite new to struts tag library and I need an advice.
In the HttpSession I have an object of type Collection, which stores
a list of MyObject.
MyOBject has two properties, description and id.
Out of this Collection of MyObject I must generate a selectable list
Which displays MyObject names, (wity MyObject.id as value)
I have tried to embed the html:select inside a logic:iterate, but my
editor (websphere studio)complaints for following code
<html:select property="defaultContainerType" multiple="no">
<logic:iterate collection="<%=
(Collection)session.getAttribute("CONTAINER_TYPES")%>" id="container">
<html:option value="<bean:write name="container"
property="type"/>">
<bean:write name="container"
property="description"/>
</html:option>
</logic:iterate>
</html:select>
the error is 'Attribute container has no value'
anyone has a suggestion on how to solve my problem?
Fact is that the Collection is stored in the session, not in a
JavaBean..
Thanks and regards
marco
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: html:select tag or logic:iterate
Posted by Firat TIRYAKI <fi...@pleksus.com.tr>.
try this,
<html:select property="defaultContainerType">
<html:options collection="CONTAINER_TYPES" property="id"
labelProperty="name"/>
</html:select>
F.
----- Original Message -----
From: "Marco Mistroni" <mm...@waersystems.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Monday, December 15, 2003 3:00 PM
Subject: html:select tag or logic:iterate
> Hi all,
> I am quite new to struts tag library and I need an advice.
> In the HttpSession I have an object of type Collection, which stores
> a list of MyObject.
> MyOBject has two properties, description and id.
>
> Out of this Collection of MyObject I must generate a selectable list
> Which displays MyObject names, (wity MyObject.id as value)
>
> I have tried to embed the html:select inside a logic:iterate, but my
> editor (websphere studio)complaints for following code
>
> <html:select property="defaultContainerType" multiple="no">
> <logic:iterate collection="<%=
> (Collection)session.getAttribute("CONTAINER_TYPES")%>" id="container">
> <html:option value="<bean:write name="container"
> property="type"/>">
> <bean:write name="container"
> property="description"/>
> </html:option>
> </logic:iterate>
> </html:select>
>
> the error is 'Attribute container has no value'
>
> anyone has a suggestion on how to solve my problem?
>
> Fact is that the Collection is stored in the session, not in a
> JavaBean..
>
> Thanks and regards
> marco
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org