You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bhanu Valasa <BV...@MISICOMPANY.com> on 2007/01/19 20:20:13 UTC

nested:select to logic:iterate or nested:iterate

Hello gurus....

 

I have struts tag in my jsp, which displays HTML select option box with
selected (a String array in the bean)

 

<nested:select property='<%=dataFrom+"Bean.prdIdsList"%>'
multiple="true" size="3" styleId='<%=dataFrom+"prdIds"+(index)%>'
styleClass="textField" >

<html:options collection="<%=IConstants.SESSION_ATTR_SCR_PRODUCTS%>"
property="id" labelProperty="value"/>

</nested:select>

 

Instead HTML Select box I want to print the String array elements in
text format.

 

Could some one please help me how to use logic:iterate or nested:iterate

 

Please suggest....

 

thanks

 


Re: nested:select to logic:iterate or nested:iterate

Posted by Nuwan Chandrasoma <my...@gmail.com>.
Hi,

According to the code sample you have given below. i dont think the 
ArrayList you are iterating contains strings. it must be having some bean 
collction.
in that bean there should be 2 attributes called id and value.

so find the bean type that is in this ArrayList and then iterate those and 
see.. for eg:-

<nested:select property='<%=dataFrom+"Bean.prdIdsList"%>'
multiple="true" size="3" styleId='<%=dataFrom+"prdIds"+(index)%>'
styleClass="textField" >

<logic:iterate name="<%=IConstants.SESSION_ATTR_SCR_PRODUCTS%>"
id="product" type="<the class name of the bean that is in this list>">
<bean:write name="product" property="value"/>
</logic:iterate>

</nested:select>

Thanks,

Nuwan



----- Original Message ----- 
From: "Bhanu Valasa" <BV...@MISICOMPANY.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Saturday, January 20, 2007 4:02 PM
Subject: RE: nested:select to logic:iterate or nested:iterate


Nuwan,

Infact I tried this....but did not help.
I could see a small select box, nothing is displayed in it. I Guess it
expects only options to be provided inside <nested:select
Even after providing the value for <bean:write it's the same....

Regards


-----Original Message-----
From: Nuwan Chandrasoma [mailto:mymailnot@gmail.com]
Sent: Saturday, January 20, 2007 3:29 AM
To: Struts Users Mailing List
Subject: Re: nested:select to logic:iterate or nested:iterate

<nested:select property='<%=dataFrom+"Bean.prdIdsList"%>'
multiple="true" size="3" styleId='<%=dataFrom+"prdIds"+(index)%>'
styleClass="textField" >

<logic:iterate name="<%=IConstants.SESSION_ATTR_SCR_PRODUCTS%>"
id="product">
<bean:write name="product"/>
</logic:iterate>

</nested:select>


Thanks,

Nuwan

----- Original Message ----- 
From: "Bhanu Valasa" <BV...@MISICOMPANY.com>
To: <us...@struts.apache.org>
Sent: Friday, January 19, 2007 7:20 PM
Subject: nested:select to logic:iterate or nested:iterate


Hello gurus....



I have struts tag in my jsp, which displays HTML select option box with
selected (a String array in the bean)



<nested:select property='<%=dataFrom+"Bean.prdIdsList"%>'
multiple="true" size="3" styleId='<%=dataFrom+"prdIds"+(index)%>'
styleClass="textField" >

<html:options collection="<%=IConstants.SESSION_ATTR_SCR_PRODUCTS%>"
property="id" labelProperty="value"/>

</nested:select>



Instead HTML Select box I want to print the String array elements in
text format.



Could some one please help me how to use logic:iterate or nested:iterate



Please suggest....



thanks





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


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


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


RE: nested:select to logic:iterate or nested:iterate

Posted by Bhanu Valasa <BV...@MISICOMPANY.com>.
Nuwan,

Infact I tried this....but did not help.
I could see a small select box, nothing is displayed in it. I Guess it
expects only options to be provided inside <nested:select
Even after providing the value for <bean:write it's the same....

Regards


-----Original Message-----
From: Nuwan Chandrasoma [mailto:mymailnot@gmail.com] 
Sent: Saturday, January 20, 2007 3:29 AM
To: Struts Users Mailing List
Subject: Re: nested:select to logic:iterate or nested:iterate

<nested:select property='<%=dataFrom+"Bean.prdIdsList"%>'
multiple="true" size="3" styleId='<%=dataFrom+"prdIds"+(index)%>'
styleClass="textField" >

<logic:iterate name="<%=IConstants.SESSION_ATTR_SCR_PRODUCTS%>" 
id="product">
<bean:write name="product"/>
</logic:iterate>

</nested:select>


Thanks,

Nuwan

----- Original Message ----- 
From: "Bhanu Valasa" <BV...@MISICOMPANY.com>
To: <us...@struts.apache.org>
Sent: Friday, January 19, 2007 7:20 PM
Subject: nested:select to logic:iterate or nested:iterate


Hello gurus....



I have struts tag in my jsp, which displays HTML select option box with
selected (a String array in the bean)



<nested:select property='<%=dataFrom+"Bean.prdIdsList"%>'
multiple="true" size="3" styleId='<%=dataFrom+"prdIds"+(index)%>'
styleClass="textField" >

<html:options collection="<%=IConstants.SESSION_ATTR_SCR_PRODUCTS%>"
property="id" labelProperty="value"/>

</nested:select>



Instead HTML Select box I want to print the String array elements in
text format.



Could some one please help me how to use logic:iterate or nested:iterate



Please suggest....



thanks





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


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


Re: nested:select to logic:iterate or nested:iterate

Posted by Nuwan Chandrasoma <my...@gmail.com>.
<nested:select property='<%=dataFrom+"Bean.prdIdsList"%>'
multiple="true" size="3" styleId='<%=dataFrom+"prdIds"+(index)%>'
styleClass="textField" >

<logic:iterate name="<%=IConstants.SESSION_ATTR_SCR_PRODUCTS%>" 
id="product">
<bean:write name="product"/>
</logic:iterate>

</nested:select>


Thanks,

Nuwan

----- Original Message ----- 
From: "Bhanu Valasa" <BV...@MISICOMPANY.com>
To: <us...@struts.apache.org>
Sent: Friday, January 19, 2007 7:20 PM
Subject: nested:select to logic:iterate or nested:iterate


Hello gurus....



I have struts tag in my jsp, which displays HTML select option box with
selected (a String array in the bean)



<nested:select property='<%=dataFrom+"Bean.prdIdsList"%>'
multiple="true" size="3" styleId='<%=dataFrom+"prdIds"+(index)%>'
styleClass="textField" >

<html:options collection="<%=IConstants.SESSION_ATTR_SCR_PRODUCTS%>"
property="id" labelProperty="value"/>

</nested:select>



Instead HTML Select box I want to print the String array elements in
text format.



Could some one please help me how to use logic:iterate or nested:iterate



Please suggest....



thanks





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