Hi,
I have problem with understanding one thing here. How do you have access to
this hidden field in Action servlet? Does it mean that in form bean you have
to have property named 'contactId'?
JK
----- Original Message -----
From: "Torsten Terp" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 26, 2001 11:05 AM
Subject: RE: How can I pass extra information on Submit button?
> Hi,
>
> I just hit the same problem last night, and did as follows:
>
> <logic:iterate id="contacts" name="actor" property="contactDataVector">
> <html:form action="showContacts">
> <html:hidden name="contacts" property="contactId"/>
> <tr>
> <td width="150">
> <html:submit property="submit"><bean:message
key="button.save"/></html:submit>
> </td>
> <td width="150">
> <html:text name="contacts" property="contactFirstNames" size="20"/>
> </td>
> ...
>
> i.e., the contacts im showing all have an id, which is the one used in the
hidden field,
> this enables me to use the correct row in the form processing... You are
trying to set
> the value of the hidden field yourself, if you instead specify the name
and property as
> above the correct value will be set automatically...
>
> ^terp
>
> > -----Original Message-----
> > From: Jerzy Kalat [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, June 26, 2001 4:38 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: How can I pass extra information on Submit button?
> >
> >
> > Hi Guys,
> >
> > I am still fighting with this issue :-(
> >
> > I have another question. How can I set value of hidden field to another
> > property.
> > As in following code, instead of value of element.id all I see in
servlet is
> > string 'element.id' :
> >
> > <table border="1">
> > <logic:iterate id="element" type="myApp.common.GeoEntity"
> > name="<%= Constants.GEO_ENTITY_LIST %>">
> > <tr>
> > <td>
> > <html:submit property="action" value="Details"/>
> > <html:hidden name="geoEntityForm" property="recordId"
> > value="element.id"/>
> > </html:submit>
> > </td>
> > <td>
> > <bean:write name="element" property="name"/>
> > </td>
> > </tr>
> > </logic:iterate>
> > </table>
> >
> > And another question. If I want to create on JSP page new bean, how can
I
> > access it in servlet?
> >
> > Thanks
> > JK
> >
> > ----- Original Message -----
> > From: "David Winterfeldt" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, June 25, 2001 3:39 PM
> > Subject: Re: How can I pass extra information on Submit button?
> >
> >
> > > I haven't done this, but you might be able to do one
> > > of these two things. You could try using JavaScript
> > > to change the value of the action and add the params
> > > dynamically or each detail button would be a separate
> > > form.
> > >
> > > <html:form action="registration"
> > > name="registrationForm">
> > > <html:submit property="action" value="Details"
> > >
> > > onclick="document.form[0].action="registration.do?id=12"/>
> > >
> > >
> > > The action will be processed correctly, but since it
> > > can't automatically look the corresponding form bean
> > > you need to specify it with the name attribute. I
> > > think this should work.
> > > <html:form action="registration.do?id=12"
> > > name="registrationForm">
> > > <html:submit property="action" value="Details"/>
> > > </html:form>
> > >
> > > David
> > >
> > > --- Jerzy Kalat <[EMAIL PROTECTED]> 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
> > > > >
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Get personalized email addresses from Yahoo! Mail
> > > http://personal.mail.yahoo.com/
> >
> >
> >