Craig,

The looping I had mentioned is for displaying the text boxes (which
grows dynamically) as well. Not sure how I could move that to the action
class. Unless I am missing something. I understand the fact that the
arguments and values for a link can be fed as a Map as you had suggested
but the (Remove) link in my example is present for each row of the
textboxes present in the page. Below is the exact situation we are
facing, It would be really helpful if you can comment on it: 

We need a bunch of dynamic textboxes laid as a table. Each row
(containing a set of textboxes) in the html table represents a group of
rows in a db table (i.e. 1 html row to many database rows translation).
User can add more (empty) html rows on the page to create new entries
into the db. The 'Remove' link is present for each html row if the row
is persistent. 

The Remove link on each row will contain only one argument: 'id' which,
for now, is part of the form, so as I iterate to display the textboxes,
I create the links based on the id value for that row...

Thanks,
Srini

>>> [EMAIL PROTECTED] 12/19/2005 12:48 PM >>>
On 12/19/05, Srini Pillai <[EMAIL PROTECTED]> wrote:
>
> Thanks Rick, for responding quickly.
>
> >>I'm not sure what you are attempting to do with:
> value="${request['FAEditorForm'].id_${counter}}"
>
> I am trying to access the value from the ActionForm for property
> 'id_0', 'id_1' etc... depending on the value of the ${counter}. The
> example you had suggested using the 'url' tag will not work for me
since
> the 'id' parameter will pass the value of the counter but I require
the
> value in the form for the 'id_?' (where '?' is any number from 0...n)
as
> mentioned above. Hope I am clear. Really appreciate your help.


As you have noticed, the EL syntax is not up to the task you're after
(of
course, <bean:write> is not going to be, either).  But, I suggest you
consider a completely different approach.

When you execute an EL expression like this:

    ${foo.bar}

what's really happening is that a bean named "foo" is found, and then
it's
getBar() method is called.  So, why not write a getBar() function on
some
bean class that returns the entire set of argument names and values
for
you?  In other words, do the looping in Java code rather than JSP.  If
this
method were on the same class that contains the list or array being
iterated
over, it should have everything it needs to calculate the appropriate
parameter values.

As a general principle, I believe that manufacturing URLs in the JSP
code
(as you are attempting here) is working too hard ... and it is really
mixing
elements of the controller into the view in undesireable ways.  Much
better
to write code in the controller that can calculate all that stuff for
you,
and then let the view code pull it out with a simple EL reference.

Thanks,
> Srini


Craig

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

Reply via email to