You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mh...@lwplus.de on 2002/06/13 11:38:39 UTC
serially numbered table
I want to have a serially numbered table.
I have a formbean which contains an array of objects which I'm going to
display.
I don't want to save the numberes in these objects.
So in the formbean I wrote a getId() and a setId(int i) method.
The formbean holds a counter which gets increased when calling getId().
<nested:form action="/saveCalendarSetting.do" scope="session">
<table>
<nested:iterate property="cnCalendarListVMI">
<tr>
<td CLASS="Innercellcenter" NOWRAP><bean:write
name="CalendarListForm" scope="session" property="id"/></td>
<td CLASS="Innercells" NOWRAP><nested:write
property="strOU_dc" /></td>
<td CLASS="Innercells" NOWRAP><nested:write
property="strCU_dc" /></td>
<td CLASS="Innercellcenter" NOWRAP><nested:checkbox
property="mbChanged" value="on"/></td>
</tr>
</nested:iterate>
</table>
<html:submit property="submitButton" value="submit" />
</nested:form>
Is there a better method doing this?
----------------------------------------------------------------------------
----------------
Hanel Matthias
Fachinformatiker (Anwendungsentwicklung) in Ausbildung
Logistik World GmbH Fon: +49-841-9014-300
Marie-Curie-Strasse 6 Fax: +49-841-9014-302
D- 85055 Ingolstadt mailto:mhanel@lwplus.de
----------------------------------------------------------------------------
----------------
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: serially numbered table
Posted by Mark Nichols <dh...@hotmail.com>.
----- Original Message -----
> I want to have a serially numbered table.
> I have a formbean which contains an array of objects which I'm going to
> display.
>
> I don't want to save the numberes in these objects.
> So in the formbean I wrote a getId() and a setId(int i) method.
>
> The formbean holds a counter which gets increased when calling getId().
>
>
> <nested:form action="/saveCalendarSetting.do" scope="session">
> <table>
> <nested:iterate property="cnCalendarListVMI">
> <tr>
> <td CLASS="Innercellcenter" NOWRAP><bean:write
> name="CalendarListForm" scope="session" property="id"/></td>
> <td CLASS="Innercells" NOWRAP><nested:write
> property="strOU_dc" /></td>
> <td CLASS="Innercells" NOWRAP><nested:write
> property="strCU_dc" /></td>
> <td CLASS="Innercellcenter" NOWRAP><nested:checkbox
> property="mbChanged" value="on"/></td>
> </tr>
> </nested:iterate>
> </table>
> <html:submit property="submitButton" value="submit" />
> </nested:form>
>
> Is there a better method doing this?
I don't know about the nested tag, but the logic:iterate tag has an indexId
parameter, which already holds the relative positioning within the
collection.
<nested:iterate property="cnCalendarListVMI" indexId="serialNumber">
[...]
>
> --------------------------------------------------------------------------
--
> ----------------
> Hanel Matthias
> Fachinformatiker (Anwendungsentwicklung) in Ausbildung
> Logistik World GmbH Fon: +49-841-9014-300
> Marie-Curie-Strasse 6 Fax: +49-841-9014-302
> D- 85055 Ingolstadt mailto:mhanel@lwplus.de
> --------------------------------------------------------------------------
--
> ----------------
>
</mark>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>