You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by amolbehl <am...@gmail.com> on 2008/09/10 16:43:36 UTC

Struts2 Iterator tag problem

Hi I am trying to display a ArrayList of lists using struts2 iterator tag.

   
      private void dataReady(){   
              for (int itr = 0; itr < this.HOURS; itr++) {   
                  tempList = new ArrayList();   
                  // Add all the till related data   
                  for(int tillItr = 0; tillItr < this.terminalList.size();
tillItr++)
                  {                  
                      tempList.add(this.transactions[itr][tillItr]);   
                      tempList.add(this.unitsSold[itr][tillItr]);      
                  }
   
                  // add all overall data  
                  tempList.add(this.peakBlocks[itr]);  
                  tempList.add(this.incCtr[itr]);  
                  tempList.add(this.percentages[itr]);
  
                  /*  
                   * Now to place this list in the list which will  
                   * render it on the screen via JSP  
                   */  
                  this.dataList.add(tempList);  
              }  
          }

Now I have tempList which is a list of int and long values and dataList
which is a list of tempLists.

I need to use the struts2 iterator tag and display it on the screen.

Is there any way of doing it?

If Iterator is not possible then is there anything else I can use?
-- 
View this message in context: http://www.nabble.com/Struts2-Iterator-tag-problem-tp19414606p19414606.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts2 Iterator tag problem

Posted by Gabriel Belingueres <be...@gmail.com>.
Something like this:

<s:interator var="tempList" value="dataList">
    <s:iterator var="number" value="#tempList">
    ....
    </s:iterator>
</s:iterator>

2008/9/10 amolbehl <am...@gmail.com>:
>
> Hi I am trying to display a ArrayList of lists using struts2 iterator tag.
>
>
>      private void dataReady(){
>              for (int itr = 0; itr < this.HOURS; itr++) {
>                  tempList = new ArrayList();
>                  // Add all the till related data
>                  for(int tillItr = 0; tillItr < this.terminalList.size();
> tillItr++)
>                  {
>                      tempList.add(this.transactions[itr][tillItr]);
>                      tempList.add(this.unitsSold[itr][tillItr]);
>                  }
>
>                  // add all overall data
>                  tempList.add(this.peakBlocks[itr]);
>                  tempList.add(this.incCtr[itr]);
>                  tempList.add(this.percentages[itr]);
>
>                  /*
>                   * Now to place this list in the list which will
>                   * render it on the screen via JSP
>                   */
>                  this.dataList.add(tempList);
>              }
>          }
>
> Now I have tempList which is a list of int and long values and dataList
> which is a list of tempLists.
>
> I need to use the struts2 iterator tag and display it on the screen.
>
> Is there any way of doing it?
>
> If Iterator is not possible then is there anything else I can use?
> --
> View this message in context: http://www.nabble.com/Struts2-Iterator-tag-problem-tp19414606p19414606.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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