struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@lexmark.com
Subject Re: Problem with Logic-iterate and enumeration
Date Thu, 06 Jun 2002 16:57:53 GMT


I hate using scriptlets, but had to do so in the end for the problem - although
could have made a custom tag I guess.  Here's what I do:

                  <TABLE BORDER="0" CELLPADDING="8" CELLSPACING="8">
                     <TR>
                        <logic:iterate id="category" name="mfdCategoriesForm"
property="categories" indexId="index">
                        <TD>
                           <bean:write name='category' property='name'/>
                        </TD>
                           <%
                              //insert rows where necessary
                              int categoriesInRow = 3;
                              if ((index.intValue() > 0 && ((index.intValue()+1)
 % categoriesInRow == 0)))
                              {
                           %>
                        </TR>
                        <TR>
                           <%
                              }
                           %>
                        </logic:iterate>
                     </TR>
                     </html:form>
                  </TABLE>

HTH,

cheers,

Dave




"struts (H2Opilot)" <struts%h2opilot.de@interlock.lexmark.com> on 06/06/2002
10:40:07 AM

Please respond to "Struts Users Mailing List"
      <struts-user%jakarta.apache.org@interlock.lexmark.com>; Please respond to
      struts%h2opilot.de@interlock.lexmark.com

To:   "Struts Users Mailing List"
      <struts-user%jakarta.apache.org@interlock.lexmark.com>
cc:    (bcc: David Hay/Lex/Lexmark)
Subject:  Problem with Logic-iterate and enumeration




hi,
I have a List of Numbers and I like to use 3 columns and n rows.

Is there a possible way to realise this via Logic-iteration.

Normally, it look like that every next step in the iteration there is
always another row.

Like this:

<table width="100%" border="0" cellspacing="1" cellpadding="1">
<logic:iterate id="element" name="bla_f" property="numberss"
type="app.Data">

  <tr bordercolor="#333366">
      <td>
        <bean:write name="element" property="number"/>
      </td>

      <td>
****** this should be the next element of Data, but how increment the
element??  *****
       <bean:write name="element" property="number"/>
      </td>

  </tr>

</logic:iterate>
</table>

any ideas?


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








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


Mime
View raw message