In a similar situation we have used a hidden input to do this.  All you
would need is a hidden input for your position and then add an onclick
event to each submit button that would set the value of the input based
on the index of your iterate loop.

For example:
form
hidden - position
iterate
        submit onclick="this.position.value=<%index of loop%>
iterate
form

Or perhaps it would make more sense to submit the selected if instead of
the position in the loop.  Hope this helps.

Laine

-----Original Message-----
From: Peter Alfors [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 25, 2001 3:39 PM
To: [EMAIL PROTECTED]
Subject: Re: How can I pass extra information on Submit button?



You could place the id in the name of the submit button...  Then the
action
could parse the name of the submit button that was pressed for the
id....
There must be a better method than this... But I have not come across
this
before, and that is what popped in my head.

Or.. If you can use javascript, you can set the form action (with the
id) and
submit the form with a simple javascript call.
However, you must be able to gaurentee that all users will have
javascript
enabled.
We do this... (But we are able to force our users to enable javascript)

Pete


Jerzy Kalat wrote:

> Yes, you can see it already in my piece of code, the first <td>
>
> ----- Original Message -----
> From: "Peter Alfors" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 25, 2001 3:24 PM
> Subject: Re: How can I pass extra information on Submit button?
>
> > Are you going to place a button next to each record in the list?
> >
> >
> > Jerzy Kalat wrote:
> >
> > > Thanks,
> > >
> > > Well, I know about this solution, but they insist on button.
> > >
> > > ----- Original Message -----
> > > From: "Peter Alfors" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, June 25, 2001 3:18 PM
> > > Subject: Re: How can I pass extra information on Submit button?
> > >
> > > > You could use a link rather than the submit button.
> > > > Then when you iterate through your result-set, you just add the
'id'
> to
> > > > the link.
> > > >
> > > > Pete
> > > >
> > > >
> > > > Jerzy Kalat wrote:
> > > >
> > > > > Hi, I list many records on the form. Each record has 'Details'
> submit
> > > > > button, which suppose to flip form from 'List'mode to
'Details'
> mode,
> > > > > where only 1 record is visible with all it fields. On my jsp
page I
> > > > > have:  <logic:iterate id="element"
type="myApp.common.GeoEntity"
> > > > > name="<%= Constants.GEO_ENTITY_LIST %>">
> > > > >  <table>
> > > > >         <tr>
> > > > >     <td>
> > > > >     <html:submit property="action" value=" Details">       <%!
WHAT
> > > > > SHOULD I PUT HERE TO PASS PROPERTY 'id' into FORM BEAN
'position'?
> > > > > %>    </html:submit>
> > > > >     </td>
> > > > >           <td><bean:write name="element" property="id"/></td>
> > > > >           <td><bean:write name="element"
property="name"/></td>
> > > > >         </tr>
> > > > >  </table>
> > > > > </logic:iterate>  I tried different things here but it does
not
> work,
> > > > > or produce error. Any hints how to do it, or is there better
way to
> > > > > approach it?     Thanks in advance,     JK
> > > >
> >

Reply via email to