struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhaarat Sharma <bhaara...@gmail.com>
Subject Re: why doesnt iterator tag provide 'next'
Date Tue, 02 Jun 2009 05:21:24 GMT
thanks dale.
Your solutions seems to be very good.

Could you or someone else please explain what exactly this line means?

<s:iterator value="%{(dataList.size()).{?(#this%2)==(#this/2)}}" >
</s:iterator>

On Sun, May 31, 2009 at 10:58 AM, Dale Newfield <dale@newfield.org> wrote:

> Bhaarat Sharma wrote:
>
>> So I'll have something like this to create my iteratorList
>>
>> int sizeList = dataList.size();
>> List iterList = new ArrayList();
>>
>> for (i = 0; i <= sizeList; i=i+2)
>> {
>>   iterList.add(i);
>> }
>>
>>
>>    So now I have a iterList. I can iterate over it in my struts2 code
>>
>> <s:iterate value="iterList" statue="stat">
>>    <s:property value="((myClass)dataList.get(stat)).someClassMethod"/>
>> <!--first item of dataList ->
>>
>>    <s:property value="((myClass)dataList.get(stat+1)).someClassMethod"/>
>> <!--second item of dataList ->
>>
>> </s:iterate>
>>
>
> You can do this completely within the jsp in a number of ways:
>
> <s:iterator value="%{(dataList.size()).{?(#this%2)==(#this/2)}}" >
> </s:iterator>
>
> <s:iterator value="%{datalist}" status="iterStatus">
>  <s:if test="#rowstatus.odd == true">
>    ...
>  </s:if>
>  <s:else>
>    ...
>  </s:else>
> </s:iterator>
>
> <s:iterator begin="%{1}" end="%{dataList.size()}" step="%{2}">
> </s:iterator>
>
> -Dale
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message