Any guess whats happening wrong here?,

the output is as follows

 4thCol 4thCol 4thCol 4thCol
 4thCol 4thCol 4thCol 4thCol

But the correct output should be as follows

 1stCol 2ndCol 3rdCol 4thCol
 1stCol 2ndCol 3rdCol 4thCol


Deepak

-----Original Message-----
From: Deepak Srivatava [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 08, 2005 6:57 PM
To: user@struts.apache.org
Subject: Problem with logic:iterate Tag


I am populating following simple List in action class and putting that in form 
class.
 
        private List getSystemTableList(ConfWizardBean confwizbean, HttpSession 
session){
                ArrayList outerList = new ArrayList();
                for (int i = 0; i < 2; i++)
                {
                    ArrayList innerList = new ArrayList();
 
                    innerList.add(0,"Ist Column");
                    innerList.add(1,"2nd Column");
                    innerList.add(2,"3rd column");
                    innerList.add(3,"4th Column");
                    outerList.add(innerList);
                }
                return outerList;
        }
 
relevant JSP code is as follows
 

  <%-- Iterate through the system list --%>
  <bean:define id="systemList" name="MyForm" property="systemTableList"/>
  <logic:present name="systemList">
  <logic:notEmpty name="systemList">
  <logic:iterate id="innerList" name="systemList" indexId="index">

  <logic:iterate id="1stCol" name="innerList" offset="0"/>
  <logic:iterate id="2ndCol" name="innerList" offset="1"/>
  <logic:iterate id="3rdCol" name="innerList" offset="2"/>
  <logic:iterate id="4thCol" name="innerList" offset="3"/>
                        
   <TD  align="center" class="bodyText" nowrap><bean:write name="1stCol" /></td>
   <TD  align=center valign=middle><bean:write name="2ndCol"/></td>
   <TD  align=center valign=middle><bean:write name="3rdCol" /></td>
   <TD  align=center valign=middle><bean:write name="4thCol"/></td>
  </logic:iterate>
  </logic:notEmpty>
  </logic:present>
 
I am trying to print the above list in Jsp page but it always print the value 
"4th Column" in all the four columns of HTML. Somehow it always uses the 
offset=3. What I am doing wrong here?.
 
Deepak


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to