"Luke Majewski" <[EMAIL PROTECTED]> writes:
eventSubmit_do<foo> decided which method named do<foo> is called in
your Action class. If you want to pass parameters you can do it like
this:
--- cut --- Edit.vm --- cut ---
<form action="$link.setPage("Edit.vm").setAction("CustomAction")">
<input type="hidden" name="param1" value="100">
<input type="text" name="param" size="10">
<input type="submit" name="eventSubmit_doConfirm" value="Confirm">
<input type="submit" name="eventSubmit_doCancel" value="Cancel">
</form>
if you press "Confirm", then doConfirm is called. If you press
"Cancel", then doCancel is called.
You then change the screen you're going to by doing
--- cut ---
public class CustomAction extends VelocityAction
{
public void doCancel(RunData data, Context ctx)
{
data.setScreenTemplate("Menu.vm");
}
public void doConfirm(RunData data, Context ctx)
{
processData(data);
data.setScreenTemplate("Confirmation.vm");
}
}
--- cut ---
That's the basic idea.
Regards
Henning
>------=_NextPart_000_0068_01C34636.F04C0CC0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>Hi,
>I've looked for a decent amount on how to pass parameters to action =
>events with no luck.
>This is a fairly simple request, so I hope someone has the answer:
>I have in my vm file:
><input type=3D"submit" name=3D"eventSubmit_doEntity" value=3D"Edit =
>Contacts"/>
>and I have a in my java:
>public void doEntity(RunData data, Context context, String entity) =
>throws Exception
>Now, I know that "data" and "context" get passed in there automatically, =
>but if I want a String of my choosing to be passed as "entity", how =
>would I go about that? I assume there is some syntax that I can use , =
>something like name=3D"eventSubmit_doEntity?entity..." etc but I can't =
>figure it out.
>Any help would be appreciated, thank you!
>Luke Majewski
>------=_NextPart_000_0068_01C34636.F04C0CC0--
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
[EMAIL PROTECTED] +49 9131 50 654 0 http://www.intermeta.de/
Java, perl, Solaris, Linux, xSP Consulting, Web Services
freelance consultant -- Jakarta Turbine Development -- hero for hire
--- Quote of the week: "It is pointless to tell people anything when
you know that they won't process the message." --- Jonathan Revusky
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]