I agree with J�rgen on this one. What I do is have the button link call a
javascript which does the submit action. The link before is just going to
build a URL and not do a form post.
so in your template use
<form name="someform" method="post" action="$link.setAction("myClass")>
</form>
<script>
doSubmit()
{
document.someform.submit();
}
</script>
On Wed, 20 Aug 2003, J�rgen Hoffmann wrote:
> Hi,
>
> I think the problem is that you use a link and you alter a hidden field
> from a form. The link does not seem to be in <form action="{link}...">
> it seems to be a regular link. When you set a regular link you should
> use something like this
>
> <a href="$link.setAction("myClass").addPathInfo("eventSubmit_doAdd",
> "add").addQueryData("myfield","1")"> +Add</a>
>
> Or something like
>
> <a href="$link.setAction("myClass").addPathInfo("eventSubmit_doAdd",
> "add").addQueryData("myfield","$velocityCount")"> +Add</a>
>
> Hidden fields are only transmitted in the request if sent through a
> form.
>
> Kind regards
>
> J�rgen Hoffmann
> ByteACTION GmbH
>
>
>
>
> -----Urspr�ngliche Nachricht-----
> Von: Luke Majewski [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 20. August 2003 07:52
> An: Turbine Users List
> Betreff: Re: $link.setAction
>
>
> 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]
> >
> >
>
>
>
> ---------------------------------------------------------------------
> 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]