Here it is, it's exactly how you wrote it.
public void doAdd(RunData data, Context context) throws Exception
{
Integer id = (Integer)data.getParameters().getInteger("id");
// do something
}
a call I succesfully use in other places where I have a submit button and not a submit
link.
and this is the javascript on the form... checked all the obvious like form name, etc:
function doAdd(depth)
{
document.Category.id.value = depth;
}
with a hidden field on the form being declared:
<input type="hidden" name="id" value="0">
pretty standard stuff.
thanks for the help!
----- Original Message -----
From: "Jeffery Painter" <[EMAIL PROTECTED]>
To: "Turbine Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, August 20, 2003 12:53 AM
Subject: Re: $link.setAction
>
> I have done the same successfully, using javascript to update hidden
> fields. Could you send a little more from your
> data.getParameters().getInt("hiddenField") routine to help identify the
> problem?
>
> THanks,
> Jeff Painter
>
>
>
>
> On Tue, 19 Aug 2003, Luke Majewski wrote:
>
> > Hello,
> >
> > I have a $link.setAction call that looks like this:
> >
> > <a href="$link.setAction("myClass").addPathInfo("eventSubmit_doAdd", "add")">
> > +Add</a>
> >
> > It is working in the sense that my doAdd function is succesfully being called from
> > "myClass." The problem I am having is with parameter passing. There are two ways
> > I can do this, the way I do it uses javascript to set a hidden field to whatever I
> > need and then I use the data.getParameters() call on the backend to grab the
> > value.
> >
> > this is what my doAdd function looks like:
> >
> > public void doAdd(RunData data, Context context) throws Exception
> >
> > Well, when I do the data.getParameters() call, all I get is 0 for my hidden
> > integer that I set. I verify that the javascript is doing the work with an alert.
> >
> > Does any one have any suggestions? I have read so many posts on this and none of
> > the solutions seems to work. It seems to me like (RunData data, Context context)
> > are not being correctly passed to my doAdd function.
> >
> > Thank you in advance for any help,
> >
> > Luke Majewski
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>