What I'm trying to accomplish is slightly more complicated than that.  Part
of why I am doing this is I want to resolve 6 action-event functions into 1,
since the primary difference between them is just this "entity" type.  By
using Keith's suggestion and a little bit of my own, I am populating a
hidden field with the correct type, getting that parameter in my action
event by using:

(String)data.getParameters().getString("entity");

and I'm all set :)

thanks for the help!


----- Original Message -----
From: "Edgar González González" <[EMAIL PROTECTED]>
To: "Turbine Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, July 09, 2003 5:07 PM
Subject: RE: parameter passing help


> Luke, Keith,
>
> Are you reviewed this:
>
http://jakarta.apache.org/turbine/turbine-2.2.1/howto/action-event-howto.htm
> l
>
> Here is the explanation how the Actions (Velocity Actions) work.
>
> I think in the Luke's scenario you need to do the following:
>
> 1) Define the several methods in your action:
> public void doContactedit(RunData data, Context context)
> {
> String parameterX = data.getParameters().getString("yourParameter"); //
e.g
> the contact Id
> // do whatever you need
> }
> public void doContactdelete(RunData data, Context context)
> ...
>
> 2) In your template (.vm) define the submit buttons need it for each event
> defined above:
>
> <input type="submit" name="eventSubmit_doContactedit" value="Edit
Contact"/>
> <input type="submit" name="eventSubmit_doContactdelete" value="Delete
> Contact"/>
>
> Hope this help you
>
> --------------------------------------------------------------------------
--
> Edgar González González
> VALHALLA Project, s.a.
> Chief Technology Officer
> Web: www.valhallaproject.com
> E-mail: [EMAIL PROTECTED]
> Phone: +58-212-242.4379 / 6662 / 4055 / 6475
> Fax: +58-212-242.6809
> "The limits of my language mean the limits of my world."
> Ludwig Wittgenstein
> --------------------------------------------------------------------------
--
>
>
>
> -----Mensaje original-----
> De: Keith Seim [mailto:[EMAIL PROTECTED]
> Enviado el: miércoles, 09 de julio de 2003 04:39 p.m.
> Para: Turbine Users List
> Asunto: Re: parameter passing help
>
>
> Ahh, parameter passing... I too have been stumped with these (see my
> messages from today ;).  I believe I can help you with this Query:
>
> Your <input> tag should be inside a <form> tag.  I believe all you need
> to do is add another tag inside the form tag (as you would in normal cgi
> programming):
>
> <input type="hidden" name="entity" value="$stringOfYourChoosing">
>
> Havn't tested it, but I'm pretty sure that should work... if it doesn't
> you can complain at me :).
>
> Oh, and if anyone can help with my posts below, it'd be appreciated!
>
> Keith
>
>
>
> On Wednesday, July 9, 2003, at 04:27  PM, Luke Majewski wrote:
>
> > 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="submit" name="eventSubmit_doEntity" value="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="eventSubmit_doEntity?entity..."
> > etc but I can't figure it out.
> >
> > Any help would be appreciated, thank you!
> >
> > Luke Majewski
> >
> ___________________________________
> Keith Seim • http://kjsdesigns.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



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

Reply via email to