You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bård Arve Evjen <ba...@operamail.com> on 2003/07/07 18:51:33 UTC

Problems with logic:iterate (indexId has no effect) - doesn't anyone know the solution?

I didn't think this was a big problem for you Struts-gurus, but maybe I'm wrong :-)

I have a vector called variationmargins and in it I have a property called loadProfile that is either 1 or 2 for all postings. I have tried to use the logic:iterate tag to output the result using the loadProfile as an index, but it has not effect. It just outputs everything, no matter the indexId. 

Does anyone have a clue what I am doing wrong?

<logic:iterate id="element" name="variationmargins" property="variationMargins" indexId="loadProfile">
<bean:write name="element" property="loadProfileName"/>
<br>
<display:table name="variationmargins" property="variationMargins" 
scope="session" width="100%" pagesize="100" requestURI="result.jsp" 
decorator="org.apache.taglibs.display.test.ColumnsWrapper">

<display:column title="<%=ldeliveryPeriod%>" property="deliveryPeriod" sort="true" width="10%"/>
<display:column title="<%=lhours%>" property="hours" align="right" sort="true" width="10%"/>
</display:table>
</logic:iterate>

I would really appreciate the help.

Cheers,
Bard A. Evjen


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


Re: Problems with logic:iterate (indexId has no effect) - doesn't anyone know the solution?

Posted by Sandeep Takhar <sa...@yahoo.com>.
I wouldn't use a vector, but maybe you can?

My understanding is that iterate works on anything
that returns an iterator.

logic:iterate name="someName" 

should be used when the bean someName is in some scope
and is the collection that you want.  

logic:iterate name="someName" property="someProperty"
should not be used if the above case is true.

sandeep
--- B�rd Arve Evjen <ba...@operamail.com> wrote:
> I didn't think this was a big problem for you
> Struts-gurus, but maybe I'm wrong :-)
> 
> I have a vector called variationmargins and in it I
> have a property called loadProfile that is either 1
> or 2 for all postings. I have tried to use the
> logic:iterate tag to output the result using the
> loadProfile as an index, but it has not effect. It
> just outputs everything, no matter the indexId. 
> 
> Does anyone have a clue what I am doing wrong?
> 
> <logic:iterate id="element" name="variationmargins"
> property="variationMargins" indexId="loadProfile">
> <bean:write name="element"
> property="loadProfileName"/>
> <br>
> <display:table name="variationmargins"
> property="variationMargins" 
> scope="session" width="100%" pagesize="100"
> requestURI="result.jsp" 
>
decorator="org.apache.taglibs.display.test.ColumnsWrapper">
> 
> <display:column title="<%=ldeliveryPeriod%>"
> property="deliveryPeriod" sort="true" width="10%"/>
> <display:column title="<%=lhours%>" property="hours"
> align="right" sort="true" width="10%"/>
> </display:table>
> </logic:iterate>
> 
> I would really appreciate the help.
> 
> Cheers,
> Bard A. Evjen
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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