struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Refl├ę <o.re...@gmx.de>
Subject AW: HTML / Struts Help
Date Wed, 13 Feb 2002 15:46:18 GMT
if you want to user javascript do it like this,
import your buttons as image and use it as a hyperlink

<a href="javascript:{document.forms[0].action='<%=
request.getContextPath()%>/do/admin/retrieveUser?username=<%=
company.getUserForm(i).getUsername()
%>&criteria=<%=companyData.getAccountName()%>';document.forms[0].submit()}">
Details</a>

maybe it`s not the best solution, but you can now redirect to different
actions for different buttons,
you can change parameters in the url and so on
-----Urspr├╝ngliche Nachricht-----
Von: Mattos, John [mailto:jmattos@Indemand.com]
Gesendet: Mittwoch, 13. Februar 2002 16:42
An: 'Struts Users Mailing List'
Betreff: RE: HTML / Struts Help


Hey

I was thinking about that (I actually have a hidden field already called
"toDo" (still working on that name)) but the problem is that it has to
change based on which button is pressed.

I could use JavaScript to set the hidden field dynamically (I don't know if
this will work with struts, but I think I can do
document.forms[0].toDo.value="process" (or whatever) but I'd rather just
have the buttons submit then be able to sort out what was pressed in the
perform method....



John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

(w) (646) 638-8391
(f) (800) 877-5301
(c) (917) 202-8450
(w) www.iNDEMAND.com

This e-mail contains privileged and/or confidential information intended for
the use of the addressee. If the reader of this e-mail is not the intended
recipient, you have received this e-mail in error and any review,
dissemination, distribution or copying is strictly prohibited. If you have
received this e-mail in error, please notify the sender immediately by
return e-mail and permanently delete the copy you received. Thank you.


-----Original Message-----
From: Wijewickrema , Dina E. [mailto:dwijewickrema@Z-TEL.com]
Sent: Wednesday, February 13, 2002 10:16 AM
To: 'Struts Users Mailing List'
Subject: RE: HTML / Struts Help


Just define a hidden field in your form. Then when you press a button define
an onclick event that sets the value of the hidden field.

For example:

<struts-html:hidden property="action"/>

<struts-html:submit property="Process"
onclick="form.action.value='Process'">

-----Original Message-----
From: Mattos, John [mailto:jmattos@Indemand.com]
Sent: Wednesday, February 13, 2002 10:12 AM
To: 'struts-user@jakarta.apache.org'
Subject: HTML / Struts Help


Hi.

I have a form that can be submitted by three different buttons, for example
the buttons read

(Button Labels)
Process
View by Org
View by Product

What I want to do is in the Action Class handling the submission, find out
which button was pressed, and act accordingly, whether it's an actionForward
(in the case of the "view" options) or kicking off another process (as will
be done by the "process" button)

So, how can I figure out what button was pressed in that Action class? Is
there a way to do that?

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014



--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message