struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Form and Iterate Tag
Date Fri, 01 Sep 2000 20:35:12 GMT
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