struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taylor Cowan" <>
Subject Re: Form and Iterate Tag
Date Fri, 01 Sep 2000 16:03:44 GMT
> * Make the entire table a single form (and somehow distinguish between the
>   multiple occurrences of the fields in each column).

Yes, thats how SilverStream does it in its data view component.

The first step would be to modify the struts field tag so that it can detect
if it is within an interate tag.  The field tag would then append an index
to its name, for example, the "FirstName" field might generate itself like

<input type="text" name="FirstName_1">
<input type="text" name="FirstName_2">

and so on.  You just have to enforce some delimiter rules on the field
names, so that the index can be reliably parsed off the end of the parameter

Taylor Cowan

----- Original Message -----
From: "Craig R. McClanahan" <>
To: <>
Sent: Friday, September 01, 2000 3:35 PM
Subject: Re: Form and Iterate Tag

> Narendar Yalamanchilli wrote:
> > Hi,
> >
> > I am trying to build a web based application using Struts. One of the
> > requirements  is to display a table of values retrieved from the
> > database. Further, these values can be updated directly from the table
> > displayed. Is there any way I can use use Iterate Tag from within a
> > Form. How will the Form class and Action class differ in this case? I
> > would really appreciate if someone can answer this for me?
> >
> > Thanks,
> > Naren
> One approach to this problem is illustrated in the Struts example
> application (see the "registration.jsp" page.  Here, we are using the
> <struts:enumerate> tag to iterate through the set of current subscriptions
> for the logged in user (which are loaded from the pseudo-database included
> with the example).  For each subscription, we are generating a set of
> hyperlinks that allow that particular subscription to be edited -- using
> an application-specific custom tag that appends the primary key of the
> relevant subscription to a standard hyperlink.  A recently suggested
> enhancement to the <struts:link> tag would make this kind of thing fairly
> easy even without an application-specific custom tag.
> Trying to update directly from the multi-row table is going to be kind of
> interesting.  The high level approaches would be:
> * Make the entire table a single form (and somehow distinguish between the
>   multiple occurrences of the fields in each column).
> * Make each row of the table a single form, with its own submit button.
> I don't know how well either of these approaches would work, because all
> the apps I've done use the previous model (linking to a separate editing
> form for making changes).
> Craig McClanahan
> ====================
> See you at ApacheCon Europe <>!
> Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
> Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
>                                     Applications to Tomcat

View raw message