"Luke Majewski" <[EMAIL PROTECTED]> writes:

>Ok, so then if I use the addQueryData technique, how do I declare my
>function in my class?

>so if I have a doAdd funtion declared like:

>public void doAdd(RunData data, Context context, int depth) throws Exception
>or
>public void doAdd(int depth) throws Exception

You method signture _MUST_ match

public void doSomething(RunData data, Context context) throws Exception

If you add or remove parameters, it won't be called. 

If you need parameters, you then do

public void doSomething(RunData data, Context context)
{
   int foo = data.getParameters().getInt("foo");
}

        Regards
                Henning

>this anchor tag:
><a href="$link.setAction("myClass").addPathInfo("eventSubmit_doAdd",
>"add").addQueryData("depth", $item.depth)">

>does not succesfully call the doAdd on the backend (it defaults to the
>doPerform function)

>So how do I declare my doAdd in my backend so my link succesfully calls it?

>thanks again, almost there I think!

>Luke Majewski


>----- Original Message -----
>From: "J�rgen Hoffmann" <[EMAIL PROTECTED]>
>To: "'Turbine Users List'" <[EMAIL PROTECTED]>
>Sent: Wednesday, August 20, 2003 4:46 AM
>Subject: AW: $link.setAction


>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]

-- 
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

"Dominate!! Dominate!! Eat your young and aggregate! I have grotty silicon!" 
      -- AOL CD when played backwards  (User Friendly - 200-10-15)

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

Reply via email to