You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Luke Majewski <lu...@verizon.net> on 2003/08/20 02:40:49 UTC

$link.setAction

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

Re: $link.setAction

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Luke Majewski" <lu...@verizon.net> writes:

>I have a $link.setAction call that looks like this:

><a href=3D"$link.setAction("myClass").addPathInfo("eventSubmit_doAdd", =
>"add")"> +Add</a>

Just a quick note:

you can use 

<a href="$link.setActionEvent("myClass", "doAdd")">Add</a>

to get the same effect and is better readable.

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: $link.setAction

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Luke Majewski" <lu...@verizon.net> writes:

>I have a $link.setAction call that looks like this:

><a href=3D"$link.setAction("myClass").addPathInfo("eventSubmit_doAdd", =
>"add")"> +Add</a>

Just a quick note:

you can use 

<a href="$link.setActionEvent("myClass", "doAdd")">Add</a>

to get the same effect and is better readable.

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +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)

Re: $link.setAction

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Luke Majewski" <lu...@verizon.net> 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" <jh...@byteaction.de>
>To: "'Turbine Users List'" <tu...@jakarta.apache.org>
>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:luke.majewski@verizon.net]
>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" <pa...@kiasoft.com>
>To: "Turbine Users List" <tu...@jakarta.apache.org>
>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: turbine-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>
>>



>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org




>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: $link.setAction

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Luke Majewski" <lu...@verizon.net> writes:

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

Ah, and it doesn't matter whether you pass your parameters from PathInfo (addPathInfo),
HTTP GET parameters (addQueryData) or HTTP POST (e.g. Forms). They all end up in the
parameter parser and you access them from data.getParameters() :


<form action="$link.setAction("FooAction").addQueryData("foo", "a").addPathInfo("foo", "b")" method="post">
  <input type="hidden" name="foo" value="c">
  <input type="submit" value="Click Me" name="eventSubmit_doFootest">
</form>

public class FooAction extends VelocityAction
{
  public void doFootest(RunData data, Context context)
  {
    String [] foos = data.getParameters().getStrings("foo");

    log.debug("We got " + foos.length + " parameters");
  }
}

should report "3".  Please test. If not, it's a bug. ;-)

	Regards
		Henning




>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

>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" <jh...@byteaction.de>
>To: "'Turbine Users List'" <tu...@jakarta.apache.org>
>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:luke.majewski@verizon.net]
>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" <pa...@kiasoft.com>
>To: "Turbine Users List" <tu...@jakarta.apache.org>
>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: turbine-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>
>>



>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org




>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: $link.setAction

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Luke Majewski" <lu...@verizon.net> writes:

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

Ah, and it doesn't matter whether you pass your parameters from PathInfo (addPathInfo),
HTTP GET parameters (addQueryData) or HTTP POST (e.g. Forms). They all end up in the
parameter parser and you access them from data.getParameters() :


<form action="$link.setAction("FooAction").addQueryData("foo", "a").addPathInfo("foo", "b")" method="post">
  <input type="hidden" name="foo" value="c">
  <input type="submit" value="Click Me" name="eventSubmit_doFootest">
</form>

public class FooAction extends VelocityAction
{
  public void doFootest(RunData data, Context context)
  {
    String [] foos = data.getParameters().getStrings("foo");

    log.debug("We got " + foos.length + " parameters");
  }
}

should report "3".  Please test. If not, it's a bug. ;-)

	Regards
		Henning




>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

>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" <jh...@byteaction.de>
>To: "'Turbine Users List'" <tu...@jakarta.apache.org>
>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:luke.majewski@verizon.net]
>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" <pa...@kiasoft.com>
>To: "Turbine Users List" <tu...@jakarta.apache.org>
>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: turbine-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>
>>



>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org




>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +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)

Re: $link.setAction

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Luke Majewski" <lu...@verizon.net> 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" <jh...@byteaction.de>
>To: "'Turbine Users List'" <tu...@jakarta.apache.org>
>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:luke.majewski@verizon.net]
>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" <pa...@kiasoft.com>
>To: "Turbine Users List" <tu...@jakarta.apache.org>
>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: turbine-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>
>>



>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org




>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +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)

Re: $link.setAction

Posted by Luke Majewski <lu...@verizon.net>.
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

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" <jh...@byteaction.de>
To: "'Turbine Users List'" <tu...@jakarta.apache.org>
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:luke.majewski@verizon.net]
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" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
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: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org




Re: $link.setAction

Posted by Luke Majewski <lu...@verizon.net>.
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

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" <jh...@byteaction.de>
To: "'Turbine Users List'" <tu...@jakarta.apache.org>
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:luke.majewski@verizon.net]
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" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
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: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: AW: $link.setAction

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Jeffery Painter <pa...@kiasoft.com> writes:


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

Or make it really cool with DOM:

function eventSubmit(formIndex, event)
{
  var field = document.createElement('input');
  field.type='hidden';
  field.name="eventSubmit_do" + event;
  field.value='1';
  document.forms[formIndex].appendChild(field);
  document.forms[formIndex].submit();
} 

If you have just one form in your page, you can write

<a href="javascript:eventSubmit("0", "Bla")">Bla</a>

and this small javascript synthesizes a new hidden field and adds it
to your form in the browser. No need for lots of hidden fields.

BTW: Anyone knows a way where I have

<form name="firstform" ....> </form>
<form name="secondform" ....> </form>

in my page and can look for a form object in the page by name?
document.forms[] only allows numbers. and I cannot make
document.<formname> work where <formname> is a variable and not a
constant.

	Regards
		Henning






>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:luke.majewski@verizon.net] 
>> 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" <pa...@kiasoft.com>
>> To: "Turbine Users List" <tu...@jakarta.apache.org>
>> 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: turbine-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>> > 
>> > 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>> 


>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +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)

Re: AW: $link.setAction

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Jeffery Painter <pa...@kiasoft.com> writes:


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

Or make it really cool with DOM:

function eventSubmit(formIndex, event)
{
  var field = document.createElement('input');
  field.type='hidden';
  field.name="eventSubmit_do" + event;
  field.value='1';
  document.forms[formIndex].appendChild(field);
  document.forms[formIndex].submit();
} 

If you have just one form in your page, you can write

<a href="javascript:eventSubmit("0", "Bla")">Bla</a>

and this small javascript synthesizes a new hidden field and adds it
to your form in the browser. No need for lots of hidden fields.

BTW: Anyone knows a way where I have

<form name="firstform" ....> </form>
<form name="secondform" ....> </form>

in my page and can look for a form object in the page by name?
document.forms[] only allows numbers. and I cannot make
document.<formname> work where <formname> is a variable and not a
constant.

	Regards
		Henning






>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:luke.majewski@verizon.net] 
>> 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" <pa...@kiasoft.com>
>> To: "Turbine Users List" <tu...@jakarta.apache.org>
>> 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: turbine-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>> > 
>> > 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>> 


>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: AW: $link.setAction

Posted by Steve Yokanovich <sy...@smythco.com>.
You may need to create two forms within the page, each with it's own set 
of input elements. This may not be the best solution but it has worked 
for me in the past when I have a limited number of inputs.

<form name="someform" method="post" 
action="$link.setAction("myclass").setPage("results.vm")">
  <input type="hidden" name="eventSubmit_doAdd" value="1">
  <input type="hidden" name="otherData" value="1">
<a href="javascript:doSubmit()">Add</a>
</form>

AND

<form name="someform" method="post" 
action="$link.setAction("myclass").setPage("results.vm")">
  <input type="hidden" name="eventSubmit_doExpand" value="1">
  <input type="hidden" name="otherData" value="1">
<a href="javascript:doSubmit()">Expand</a>
</form>

Good luck,

Steve Yokanovich


Luke Majewski wrote:

> This works _almost_ :)
> 
> I like this suggestion it works very well, but now i have the problem that I
> have two functions being called by two different links, so I have:
> 
> <input type="hidden" name="eventSubmit_doExpand" value="1">
> <input type="hidden" name="eventSubmit_doAdd" value="1">
> 
> and now what happens is that depending on which link I hit, either the
> Expand or the Add, the backend function called will always be the same.  So
> in other words, if a vist my page, hit "add", it calls the add function in
> my backend.  But then if I hit the "expand" link, it also calls the add
> function in my backend.  Any suggestions as to how to, for lack of a better
> word, "clear" the page so that this behavior is not observed?
> 
> thank you!
> 


Re: AW: $link.setAction

Posted by Luke Majewski <lu...@verizon.net>.
Thank you for all your replies, they are very helpful.  I had seen the
action-event how to and had read about the action.eventsubmit.needsvalue
property but it had not made sense until last night.  A fundamental
understanding of how action events and parameters are passed from form to
backend was achieved last night, which makes this much easier.  As you say,
there is no difference between addQeueryData,  addPathInfo, etc, since they
create the same signature and that is what the backend looks for (btw, I got
the addQueryData stuff from archived turbine list responses, I think this is
the first time that the action event thread has been this thoroughly and
correctly responded to).  Thank you all for your responses, they were very
helpful!

cheers,

Luke Majewski

----- Original Message -----
From: "Henning P. Schmiedehausen" <hp...@intermeta.de>
Newsgroups: hometree.jakarta.turbine.users
To: <tu...@jakarta.apache.org>
Sent: Thursday, August 21, 2003 3:45 AM
Subject: Re: AW: $link.setAction


> "Luke Majewski" <lu...@verizon.net> writes:
>
> >This works _almost_ :)
>
> >I like this suggestion it works very well, but now i have the problem
that I
> >have two functions being called by two different links, so I have:
>
> ><input type="hidden" name="eventSubmit_doExpand" value="1">
> ><input type="hidden" name="eventSubmit_doAdd" value="1">
>
> >and now what happens is that depending on which link I hit, either the
> >Expand or the Add, the backend function called will always be the same.
So
> >in other words, if a vist my page, hit "add", it calls the add function
in
> >my backend.  But then if I hit the "expand" link, it also calls the add
> >function in my backend.  Any suggestions as to how to, for lack of a
better
> >word, "clear" the page so that this behavior is not observed?
>
> Read the docs. ;-)
>
> make this value="0" , use javascript to change the value of the event
> that you want to submit to "1" in your javascript submit function and
> add
>
> action.eventsubmit.needsvalue = true
>
> to your TR.props (this is documented in the action-event howto. Right
> at the bottom of the page. ;-) )
>
> However, you're better off with the DOM solution I've posted a few
> seconds ago. No need to drag lots of hidden fields around.
>
> Regards
> Henning
>
>
>
> >thank you!
>
> >Luke
>
>
> >----- Original Message -----
> >From: "Jeffery Painter" <pa...@kiasoft.com>
> >To: "Turbine Users List" <tu...@jakarta.apache.org>
> >Sent: Wednesday, August 20, 2003 5:25 PM
> >Subject: Re: AW: $link.setAction
>
>
> >>
> >> You could set the function you want called in your action class in a
> >> hidden field.
> >>
> >> <form
> >> name="someform"
> >> method="post"
> >> action="$link.setAction("myclass").setPage("results.vm")">
> >>
> >> <input type="hidden" name="eventSubmit_doAdd" value="1">
> >> <input type="hidden" name="otherData" value="1">
> >>
> >> <a href="javascript:doSubmit()">Add</a>
> >>
> >> </form>
> >>
> >> It works just as well as using a form submit element.
> >>
> >> You should only pass data and context through the doAdd function, use
> >> data.getParameters() to pull the otherData variable... these variables
> >> will not be passed directly to
> >>
> >> doAdd(Rundata data, Context context)
> >>
> >> good luck,
> >> Jeff Painter
> >>
> >> On Wed, 20 Aug 2003, Luke Majewski wrote:
> >>
> >> > Right, but the problem here is how do I specify what function I want
> >called
> >> > in "myClass" doing it this way.  I don't want a button, I want a
link,
> >and
> >> > when I use a link and use the onClick (and submit the form through
> >> > javascript) it didn't work either.  I'll try a couple other
variations
> >and
> >> > get back to everyone about this.
> >> >
> >> > Thank you for everyone's help!
> >> >
> >> > Luke Majewski
> >> >
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >>
> >>
>
>
>
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
> --
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> hps@intermeta.de        +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: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: AW: $link.setAction

Posted by Luke Majewski <lu...@verizon.net>.
Thank you for all your replies, they are very helpful.  I had seen the
action-event how to and had read about the action.eventsubmit.needsvalue
property but it had not made sense until last night.  A fundamental
understanding of how action events and parameters are passed from form to
backend was achieved last night, which makes this much easier.  As you say,
there is no difference between addQeueryData,  addPathInfo, etc, since they
create the same signature and that is what the backend looks for (btw, I got
the addQueryData stuff from archived turbine list responses, I think this is
the first time that the action event thread has been this thoroughly and
correctly responded to).  Thank you all for your responses, they were very
helpful!

cheers,

Luke Majewski

----- Original Message -----
From: "Henning P. Schmiedehausen" <hp...@intermeta.de>
Newsgroups: hometree.jakarta.turbine.users
To: <tu...@jakarta.apache.org>
Sent: Thursday, August 21, 2003 3:45 AM
Subject: Re: AW: $link.setAction


> "Luke Majewski" <lu...@verizon.net> writes:
>
> >This works _almost_ :)
>
> >I like this suggestion it works very well, but now i have the problem
that I
> >have two functions being called by two different links, so I have:
>
> ><input type="hidden" name="eventSubmit_doExpand" value="1">
> ><input type="hidden" name="eventSubmit_doAdd" value="1">
>
> >and now what happens is that depending on which link I hit, either the
> >Expand or the Add, the backend function called will always be the same.
So
> >in other words, if a vist my page, hit "add", it calls the add function
in
> >my backend.  But then if I hit the "expand" link, it also calls the add
> >function in my backend.  Any suggestions as to how to, for lack of a
better
> >word, "clear" the page so that this behavior is not observed?
>
> Read the docs. ;-)
>
> make this value="0" , use javascript to change the value of the event
> that you want to submit to "1" in your javascript submit function and
> add
>
> action.eventsubmit.needsvalue = true
>
> to your TR.props (this is documented in the action-event howto. Right
> at the bottom of the page. ;-) )
>
> However, you're better off with the DOM solution I've posted a few
> seconds ago. No need to drag lots of hidden fields around.
>
> Regards
> Henning
>
>
>
> >thank you!
>
> >Luke
>
>
> >----- Original Message -----
> >From: "Jeffery Painter" <pa...@kiasoft.com>
> >To: "Turbine Users List" <tu...@jakarta.apache.org>
> >Sent: Wednesday, August 20, 2003 5:25 PM
> >Subject: Re: AW: $link.setAction
>
>
> >>
> >> You could set the function you want called in your action class in a
> >> hidden field.
> >>
> >> <form
> >> name="someform"
> >> method="post"
> >> action="$link.setAction("myclass").setPage("results.vm")">
> >>
> >> <input type="hidden" name="eventSubmit_doAdd" value="1">
> >> <input type="hidden" name="otherData" value="1">
> >>
> >> <a href="javascript:doSubmit()">Add</a>
> >>
> >> </form>
> >>
> >> It works just as well as using a form submit element.
> >>
> >> You should only pass data and context through the doAdd function, use
> >> data.getParameters() to pull the otherData variable... these variables
> >> will not be passed directly to
> >>
> >> doAdd(Rundata data, Context context)
> >>
> >> good luck,
> >> Jeff Painter
> >>
> >> On Wed, 20 Aug 2003, Luke Majewski wrote:
> >>
> >> > Right, but the problem here is how do I specify what function I want
> >called
> >> > in "myClass" doing it this way.  I don't want a button, I want a
link,
> >and
> >> > when I use a link and use the onClick (and submit the form through
> >> > javascript) it didn't work either.  I'll try a couple other
variations
> >and
> >> > get back to everyone about this.
> >> >
> >> > Thank you for everyone's help!
> >> >
> >> > Luke Majewski
> >> >
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >>
> >>
>
>
>
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
> --
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> hps@intermeta.de        +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: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>



Re: AW: $link.setAction

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Luke Majewski" <lu...@verizon.net> writes:

>This works _almost_ :)

>I like this suggestion it works very well, but now i have the problem that I
>have two functions being called by two different links, so I have:

><input type="hidden" name="eventSubmit_doExpand" value="1">
><input type="hidden" name="eventSubmit_doAdd" value="1">

>and now what happens is that depending on which link I hit, either the
>Expand or the Add, the backend function called will always be the same.  So
>in other words, if a vist my page, hit "add", it calls the add function in
>my backend.  But then if I hit the "expand" link, it also calls the add
>function in my backend.  Any suggestions as to how to, for lack of a better
>word, "clear" the page so that this behavior is not observed?

Read the docs. ;-) 

make this value="0" , use javascript to change the value of the event
that you want to submit to "1" in your javascript submit function and
add

action.eventsubmit.needsvalue = true

to your TR.props (this is documented in the action-event howto. Right
at the bottom of the page. ;-) )

However, you're better off with the DOM solution I've posted a few
seconds ago. No need to drag lots of hidden fields around.

	Regards
		Henning



>thank you!

>Luke


>----- Original Message -----
>From: "Jeffery Painter" <pa...@kiasoft.com>
>To: "Turbine Users List" <tu...@jakarta.apache.org>
>Sent: Wednesday, August 20, 2003 5:25 PM
>Subject: Re: AW: $link.setAction


>>
>> You could set the function you want called in your action class in a
>> hidden field.
>>
>> <form
>> name="someform"
>> method="post"
>> action="$link.setAction("myclass").setPage("results.vm")">
>>
>> <input type="hidden" name="eventSubmit_doAdd" value="1">
>> <input type="hidden" name="otherData" value="1">
>>
>> <a href="javascript:doSubmit()">Add</a>
>>
>> </form>
>>
>> It works just as well as using a form submit element.
>>
>> You should only pass data and context through the doAdd function, use
>> data.getParameters() to pull the otherData variable... these variables
>> will not be passed directly to
>>
>> doAdd(Rundata data, Context context)
>>
>> good luck,
>> Jeff Painter
>>
>> On Wed, 20 Aug 2003, Luke Majewski wrote:
>>
>> > Right, but the problem here is how do I specify what function I want
>called
>> > in "myClass" doing it this way.  I don't want a button, I want a link,
>and
>> > when I use a link and use the onClick (and submit the form through
>> > javascript) it didn't work either.  I'll try a couple other variations
>and
>> > get back to everyone about this.
>> >
>> > Thank you for everyone's help!
>> >
>> > Luke Majewski
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>
>>



>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +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)

Re: AW: $link.setAction

Posted by Steve Yokanovich <sy...@smythco.com>.
You may need to create two forms within the page, each with it's own set 
of input elements. This may not be the best solution but it has worked 
for me in the past when I have a limited number of inputs.

<form name="someform" method="post" 
action="$link.setAction("myclass").setPage("results.vm")">
  <input type="hidden" name="eventSubmit_doAdd" value="1">
  <input type="hidden" name="otherData" value="1">
<a href="javascript:doSubmit()">Add</a>
</form>

AND

<form name="someform" method="post" 
action="$link.setAction("myclass").setPage("results.vm")">
  <input type="hidden" name="eventSubmit_doExpand" value="1">
  <input type="hidden" name="otherData" value="1">
<a href="javascript:doSubmit()">Expand</a>
</form>

Good luck,

Steve Yokanovich


Luke Majewski wrote:

> This works _almost_ :)
> 
> I like this suggestion it works very well, but now i have the problem that I
> have two functions being called by two different links, so I have:
> 
> <input type="hidden" name="eventSubmit_doExpand" value="1">
> <input type="hidden" name="eventSubmit_doAdd" value="1">
> 
> and now what happens is that depending on which link I hit, either the
> Expand or the Add, the backend function called will always be the same.  So
> in other words, if a vist my page, hit "add", it calls the add function in
> my backend.  But then if I hit the "expand" link, it also calls the add
> function in my backend.  Any suggestions as to how to, for lack of a better
> word, "clear" the page so that this behavior is not observed?
> 
> thank you!
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: AW: $link.setAction

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Luke Majewski" <lu...@verizon.net> writes:

>This works _almost_ :)

>I like this suggestion it works very well, but now i have the problem that I
>have two functions being called by two different links, so I have:

><input type="hidden" name="eventSubmit_doExpand" value="1">
><input type="hidden" name="eventSubmit_doAdd" value="1">

>and now what happens is that depending on which link I hit, either the
>Expand or the Add, the backend function called will always be the same.  So
>in other words, if a vist my page, hit "add", it calls the add function in
>my backend.  But then if I hit the "expand" link, it also calls the add
>function in my backend.  Any suggestions as to how to, for lack of a better
>word, "clear" the page so that this behavior is not observed?

Read the docs. ;-) 

make this value="0" , use javascript to change the value of the event
that you want to submit to "1" in your javascript submit function and
add

action.eventsubmit.needsvalue = true

to your TR.props (this is documented in the action-event howto. Right
at the bottom of the page. ;-) )

However, you're better off with the DOM solution I've posted a few
seconds ago. No need to drag lots of hidden fields around.

	Regards
		Henning



>thank you!

>Luke


>----- Original Message -----
>From: "Jeffery Painter" <pa...@kiasoft.com>
>To: "Turbine Users List" <tu...@jakarta.apache.org>
>Sent: Wednesday, August 20, 2003 5:25 PM
>Subject: Re: AW: $link.setAction


>>
>> You could set the function you want called in your action class in a
>> hidden field.
>>
>> <form
>> name="someform"
>> method="post"
>> action="$link.setAction("myclass").setPage("results.vm")">
>>
>> <input type="hidden" name="eventSubmit_doAdd" value="1">
>> <input type="hidden" name="otherData" value="1">
>>
>> <a href="javascript:doSubmit()">Add</a>
>>
>> </form>
>>
>> It works just as well as using a form submit element.
>>
>> You should only pass data and context through the doAdd function, use
>> data.getParameters() to pull the otherData variable... these variables
>> will not be passed directly to
>>
>> doAdd(Rundata data, Context context)
>>
>> good luck,
>> Jeff Painter
>>
>> On Wed, 20 Aug 2003, Luke Majewski wrote:
>>
>> > Right, but the problem here is how do I specify what function I want
>called
>> > in "myClass" doing it this way.  I don't want a button, I want a link,
>and
>> > when I use a link and use the onClick (and submit the form through
>> > javascript) it didn't work either.  I'll try a couple other variations
>and
>> > get back to everyone about this.
>> >
>> > Thank you for everyone's help!
>> >
>> > Luke Majewski
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>
>>



>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: AW: $link.setAction

Posted by Luke Majewski <lu...@verizon.net>.
This is perfect (although forces JS, yes...)

I like this better than creating two forms, because my links are close to
each other in a table that is being created through a loop (velocity macro),
it would be hard if not impossible to seperate out into two forms.

This is great, though, thank you very very very much!

Luke Majewski

----- Original Message -----
From: "Mitch Christensen" <mi...@informatixinc.com>
To: "'Turbine Users List'" <tu...@jakarta.apache.org>
Sent: Wednesday, August 20, 2003 8:36 PM
Subject: RE: AW: $link.setAction


> Our solution to this dilemma was to set the eventSubmit_ input element
> dynamically using JavaScript (I know...I don't like using JS either :)
> ).  This is in our global JS include file.
>
> The relevant JS code looks like this...
>
> /*
>  * Used for adding a hidden <input/> tag to the search form.
>  *
>  * form  - The form to submit.
>  * event - The action event name.  Maps to a method of the action class.
>  * value - Passed to the action event handler.
>  */
> function invokeActionEvent(form, event, value) {
>     // construct the navigation input tag element
>     var inputTag = document.createElement("input");
>     inputTag.type = "hidden";
>
>     // specify the 'doXxxxxx' action event
>     inputTag.name = "eventSubmit_do" + event;
>     inputTag.value = value;
>
>     // add the tag to the search form
>     document.forms[form].appendChild(inputTag);
>
>     // submit the form
>     document.forms[form].submit();
>
>     // remove the tag from the form, because we are done with it
>     document.forms[form].removeChild(inputTag);
> }
>
> -Mitch
>
> -----Original Message-----
> From: Luke Majewski [mailto:luke.majewski@verizon.net]
> Sent: Wednesday, August 20, 2003 3:11 PM
> To: Turbine Users List
> Subject: Re: AW: $link.setAction
>
> This works _almost_ :)
>
> I like this suggestion it works very well, but now i have the problem
> that I
> have two functions being called by two different links, so I have:
>
> <input type="hidden" name="eventSubmit_doExpand" value="1">
> <input type="hidden" name="eventSubmit_doAdd" value="1">
>
> and now what happens is that depending on which link I hit, either the
> Expand or the Add, the backend function called will always be the same.
> So
> in other words, if a vist my page, hit "add", it calls the add function
> in
> my backend.  But then if I hit the "expand" link, it also calls the add
> function in my backend.  Any suggestions as to how to, for lack of a
> better
> word, "clear" the page so that this behavior is not observed?
>
> thank you!
>
> Luke
>
>
> ----- Original Message -----
> From: "Jeffery Painter" <pa...@kiasoft.com>
> To: "Turbine Users List" <tu...@jakarta.apache.org>
> Sent: Wednesday, August 20, 2003 5:25 PM
> Subject: Re: AW: $link.setAction
>
>
> >
> > You could set the function you want called in your action class in a
> > hidden field.
> >
> > <form
> > name="someform"
> > method="post"
> > action="$link.setAction("myclass").setPage("results.vm")">
> >
> > <input type="hidden" name="eventSubmit_doAdd" value="1">
> > <input type="hidden" name="otherData" value="1">
> >
> > <a href="javascript:doSubmit()">Add</a>
> >
> > </form>
> >
> > It works just as well as using a form submit element.
> >
> > You should only pass data and context through the doAdd function, use
> > data.getParameters() to pull the otherData variable... these variables
> > will not be passed directly to
> >
> > doAdd(Rundata data, Context context)
> >
> > good luck,
> > Jeff Painter
> >
> > On Wed, 20 Aug 2003, Luke Majewski wrote:
> >
> > > Right, but the problem here is how do I specify what function I want
> called
> > > in "myClass" doing it this way.  I don't want a button, I want a
> link,
> and
> > > when I use a link and use the onClick (and submit the form through
> > > javascript) it didn't work either.  I'll try a couple other
> variations
> and
> > > get back to everyone about this.
> > >
> > > Thank you for everyone's help!
> > >
> > > Luke Majewski
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>



Re: AW: $link.setAction

Posted by Luke Majewski <lu...@verizon.net>.
This is perfect (although forces JS, yes...)

I like this better than creating two forms, because my links are close to
each other in a table that is being created through a loop (velocity macro),
it would be hard if not impossible to seperate out into two forms.

This is great, though, thank you very very very much!

Luke Majewski

----- Original Message -----
From: "Mitch Christensen" <mi...@informatixinc.com>
To: "'Turbine Users List'" <tu...@jakarta.apache.org>
Sent: Wednesday, August 20, 2003 8:36 PM
Subject: RE: AW: $link.setAction


> Our solution to this dilemma was to set the eventSubmit_ input element
> dynamically using JavaScript (I know...I don't like using JS either :)
> ).  This is in our global JS include file.
>
> The relevant JS code looks like this...
>
> /*
>  * Used for adding a hidden <input/> tag to the search form.
>  *
>  * form  - The form to submit.
>  * event - The action event name.  Maps to a method of the action class.
>  * value - Passed to the action event handler.
>  */
> function invokeActionEvent(form, event, value) {
>     // construct the navigation input tag element
>     var inputTag = document.createElement("input");
>     inputTag.type = "hidden";
>
>     // specify the 'doXxxxxx' action event
>     inputTag.name = "eventSubmit_do" + event;
>     inputTag.value = value;
>
>     // add the tag to the search form
>     document.forms[form].appendChild(inputTag);
>
>     // submit the form
>     document.forms[form].submit();
>
>     // remove the tag from the form, because we are done with it
>     document.forms[form].removeChild(inputTag);
> }
>
> -Mitch
>
> -----Original Message-----
> From: Luke Majewski [mailto:luke.majewski@verizon.net]
> Sent: Wednesday, August 20, 2003 3:11 PM
> To: Turbine Users List
> Subject: Re: AW: $link.setAction
>
> This works _almost_ :)
>
> I like this suggestion it works very well, but now i have the problem
> that I
> have two functions being called by two different links, so I have:
>
> <input type="hidden" name="eventSubmit_doExpand" value="1">
> <input type="hidden" name="eventSubmit_doAdd" value="1">
>
> and now what happens is that depending on which link I hit, either the
> Expand or the Add, the backend function called will always be the same.
> So
> in other words, if a vist my page, hit "add", it calls the add function
> in
> my backend.  But then if I hit the "expand" link, it also calls the add
> function in my backend.  Any suggestions as to how to, for lack of a
> better
> word, "clear" the page so that this behavior is not observed?
>
> thank you!
>
> Luke
>
>
> ----- Original Message -----
> From: "Jeffery Painter" <pa...@kiasoft.com>
> To: "Turbine Users List" <tu...@jakarta.apache.org>
> Sent: Wednesday, August 20, 2003 5:25 PM
> Subject: Re: AW: $link.setAction
>
>
> >
> > You could set the function you want called in your action class in a
> > hidden field.
> >
> > <form
> > name="someform"
> > method="post"
> > action="$link.setAction("myclass").setPage("results.vm")">
> >
> > <input type="hidden" name="eventSubmit_doAdd" value="1">
> > <input type="hidden" name="otherData" value="1">
> >
> > <a href="javascript:doSubmit()">Add</a>
> >
> > </form>
> >
> > It works just as well as using a form submit element.
> >
> > You should only pass data and context through the doAdd function, use
> > data.getParameters() to pull the otherData variable... these variables
> > will not be passed directly to
> >
> > doAdd(Rundata data, Context context)
> >
> > good luck,
> > Jeff Painter
> >
> > On Wed, 20 Aug 2003, Luke Majewski wrote:
> >
> > > Right, but the problem here is how do I specify what function I want
> called
> > > in "myClass" doing it this way.  I don't want a button, I want a
> link,
> and
> > > when I use a link and use the onClick (and submit the form through
> > > javascript) it didn't work either.  I'll try a couple other
> variations
> and
> > > get back to everyone about this.
> > >
> > > Thank you for everyone's help!
> > >
> > > Luke Majewski
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: AW: $link.setAction

Posted by Mitch Christensen <mi...@informatixinc.com>.
Our solution to this dilemma was to set the eventSubmit_ input element
dynamically using JavaScript (I know...I don't like using JS either :)
).  This is in our global JS include file.

The relevant JS code looks like this...

/*
 * Used for adding a hidden <input/> tag to the search form.
 *
 * form  - The form to submit.
 * event - The action event name.  Maps to a method of the action class.
 * value - Passed to the action event handler.
 */
function invokeActionEvent(form, event, value) {
    // construct the navigation input tag element
    var inputTag = document.createElement("input");
    inputTag.type = "hidden";

    // specify the 'doXxxxxx' action event
    inputTag.name = "eventSubmit_do" + event;
    inputTag.value = value;

    // add the tag to the search form
    document.forms[form].appendChild(inputTag);

    // submit the form
    document.forms[form].submit();

    // remove the tag from the form, because we are done with it
    document.forms[form].removeChild(inputTag);
}

-Mitch

-----Original Message-----
From: Luke Majewski [mailto:luke.majewski@verizon.net] 
Sent: Wednesday, August 20, 2003 3:11 PM
To: Turbine Users List
Subject: Re: AW: $link.setAction

This works _almost_ :)

I like this suggestion it works very well, but now i have the problem
that I
have two functions being called by two different links, so I have:

<input type="hidden" name="eventSubmit_doExpand" value="1">
<input type="hidden" name="eventSubmit_doAdd" value="1">

and now what happens is that depending on which link I hit, either the
Expand or the Add, the backend function called will always be the same.
So
in other words, if a vist my page, hit "add", it calls the add function
in
my backend.  But then if I hit the "expand" link, it also calls the add
function in my backend.  Any suggestions as to how to, for lack of a
better
word, "clear" the page so that this behavior is not observed?

thank you!

Luke


----- Original Message -----
From: "Jeffery Painter" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, August 20, 2003 5:25 PM
Subject: Re: AW: $link.setAction


>
> You could set the function you want called in your action class in a
> hidden field.
>
> <form
> name="someform"
> method="post"
> action="$link.setAction("myclass").setPage("results.vm")">
>
> <input type="hidden" name="eventSubmit_doAdd" value="1">
> <input type="hidden" name="otherData" value="1">
>
> <a href="javascript:doSubmit()">Add</a>
>
> </form>
>
> It works just as well as using a form submit element.
>
> You should only pass data and context through the doAdd function, use
> data.getParameters() to pull the otherData variable... these variables
> will not be passed directly to
>
> doAdd(Rundata data, Context context)
>
> good luck,
> Jeff Painter
>
> On Wed, 20 Aug 2003, Luke Majewski wrote:
>
> > Right, but the problem here is how do I specify what function I want
called
> > in "myClass" doing it this way.  I don't want a button, I want a
link,
and
> > when I use a link and use the onClick (and submit the form through
> > javascript) it didn't work either.  I'll try a couple other
variations
and
> > get back to everyone about this.
> >
> > Thank you for everyone's help!
> >
> > Luke Majewski
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: AW: $link.setAction

Posted by Mitch Christensen <mi...@informatixinc.com>.
Our solution to this dilemma was to set the eventSubmit_ input element
dynamically using JavaScript (I know...I don't like using JS either :)
).  This is in our global JS include file.

The relevant JS code looks like this...

/*
 * Used for adding a hidden <input/> tag to the search form.
 *
 * form  - The form to submit.
 * event - The action event name.  Maps to a method of the action class.
 * value - Passed to the action event handler.
 */
function invokeActionEvent(form, event, value) {
    // construct the navigation input tag element
    var inputTag = document.createElement("input");
    inputTag.type = "hidden";

    // specify the 'doXxxxxx' action event
    inputTag.name = "eventSubmit_do" + event;
    inputTag.value = value;

    // add the tag to the search form
    document.forms[form].appendChild(inputTag);

    // submit the form
    document.forms[form].submit();

    // remove the tag from the form, because we are done with it
    document.forms[form].removeChild(inputTag);
}

-Mitch

-----Original Message-----
From: Luke Majewski [mailto:luke.majewski@verizon.net] 
Sent: Wednesday, August 20, 2003 3:11 PM
To: Turbine Users List
Subject: Re: AW: $link.setAction

This works _almost_ :)

I like this suggestion it works very well, but now i have the problem
that I
have two functions being called by two different links, so I have:

<input type="hidden" name="eventSubmit_doExpand" value="1">
<input type="hidden" name="eventSubmit_doAdd" value="1">

and now what happens is that depending on which link I hit, either the
Expand or the Add, the backend function called will always be the same.
So
in other words, if a vist my page, hit "add", it calls the add function
in
my backend.  But then if I hit the "expand" link, it also calls the add
function in my backend.  Any suggestions as to how to, for lack of a
better
word, "clear" the page so that this behavior is not observed?

thank you!

Luke


----- Original Message -----
From: "Jeffery Painter" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, August 20, 2003 5:25 PM
Subject: Re: AW: $link.setAction


>
> You could set the function you want called in your action class in a
> hidden field.
>
> <form
> name="someform"
> method="post"
> action="$link.setAction("myclass").setPage("results.vm")">
>
> <input type="hidden" name="eventSubmit_doAdd" value="1">
> <input type="hidden" name="otherData" value="1">
>
> <a href="javascript:doSubmit()">Add</a>
>
> </form>
>
> It works just as well as using a form submit element.
>
> You should only pass data and context through the doAdd function, use
> data.getParameters() to pull the otherData variable... these variables
> will not be passed directly to
>
> doAdd(Rundata data, Context context)
>
> good luck,
> Jeff Painter
>
> On Wed, 20 Aug 2003, Luke Majewski wrote:
>
> > Right, but the problem here is how do I specify what function I want
called
> > in "myClass" doing it this way.  I don't want a button, I want a
link,
and
> > when I use a link and use the onClick (and submit the form through
> > javascript) it didn't work either.  I'll try a couple other
variations
and
> > get back to everyone about this.
> >
> > Thank you for everyone's help!
> >
> > Luke Majewski
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


AW: AW: $link.setAction

Posted by Jürgen Hoffmann <jh...@byteaction.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can do it without JS by doing

<a href="$link.setActionEvent("MyAction",
"doExpand").setPage("whatever.vm")">expand</a>
<a href="$link.setActionEvent("MyAction",
"doAdd").setPage("whatever.vm")">add</a>

Then only the corresponding Action Event to the link will be called.

Kind regards
 
Jürgen Hoffmann

- -----Ursprüngliche Nachricht-----
Von: Luke Majewski [mailto:luke.majewski@verizon.net] 
Gesendet: Donnerstag, 21. August 2003 00:11
An: Turbine Users List
Betreff: Re: AW: $link.setAction


This works _almost_ :)

I like this suggestion it works very well, but now i have the problem
that I have two functions being called by two different links, so I
have:

<input type="hidden" name="eventSubmit_doExpand" value="1"> <input
type="hidden" name="eventSubmit_doAdd" value="1">

and now what happens is that depending on which link I hit, either
the Expand or the Add, the backend function called will always be the
same.  So in other words, if a vist my page, hit "add", it calls the
add function in my backend.  But then if I hit the "expand" link, it
also calls the add function in my backend.  Any suggestions as to how
to, for lack of a better word, "clear" the page so that this behavior
is not observed?

thank you!

Luke


- ----- Original Message -----
From: "Jeffery Painter" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, August 20, 2003 5:25 PM
Subject: Re: AW: $link.setAction


>
> You could set the function you want called in your action class in
> a  hidden field.
>
> <form
> name="someform"
> method="post" 
> action="$link.setAction("myclass").setPage("results.vm")">
>
> <input type="hidden" name="eventSubmit_doAdd" value="1"> <input 
> type="hidden" name="otherData" value="1">
>
> <a href="javascript:doSubmit()">Add</a>
>
> </form>
>
> It works just as well as using a form submit element.
>
> You should only pass data and context through the doAdd function,
> use data.getParameters() to pull the otherData variable... these
> variables  will not be passed directly to
>
> doAdd(Rundata data, Context context)
>
> good luck,
> Jeff Painter
>
> On Wed, 20 Aug 2003, Luke Majewski wrote:
>
> > Right, but the problem here is how do I specify what function I
> > want 
called
> > in "myClass" doing it this way.  I don't want a button, I want a 
> > link,
and
> > when I use a link and use the onClick (and submit the form
> > through javascript) it didn't work either.  I'll try a couple
> > other 
> > variations
and
> > get back to everyone about this.
> >
> > Thank you for everyone's help!
> >
> > Luke Majewski
> >
> >
>
>
> --------------------------------------------------------------------
> - To unsubscribe, e-mail:
> turbine-user-unsubscribe@jakarta.apache.org For additional
> commands, e-mail: turbine-user-help@jakarta.apache.org 
>
>



- ---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBP0Ro1WwBrh6aH7CGEQIX3QCeNrKEhWLSrYUnfby8gFbL0CZmqgQAoOhe
PGZLe/KzKjgfM3OvlGYx1shv
=crrF
-----END PGP SIGNATURE-----



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


AW: AW: $link.setAction

Posted by Jürgen Hoffmann <jh...@byteaction.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can do it without JS by doing

<a href="$link.setActionEvent("MyAction",
"doExpand").setPage("whatever.vm")">expand</a>
<a href="$link.setActionEvent("MyAction",
"doAdd").setPage("whatever.vm")">add</a>

Then only the corresponding Action Event to the link will be called.

Kind regards
 
Jürgen Hoffmann

- -----Ursprüngliche Nachricht-----
Von: Luke Majewski [mailto:luke.majewski@verizon.net] 
Gesendet: Donnerstag, 21. August 2003 00:11
An: Turbine Users List
Betreff: Re: AW: $link.setAction


This works _almost_ :)

I like this suggestion it works very well, but now i have the problem
that I have two functions being called by two different links, so I
have:

<input type="hidden" name="eventSubmit_doExpand" value="1"> <input
type="hidden" name="eventSubmit_doAdd" value="1">

and now what happens is that depending on which link I hit, either
the Expand or the Add, the backend function called will always be the
same.  So in other words, if a vist my page, hit "add", it calls the
add function in my backend.  But then if I hit the "expand" link, it
also calls the add function in my backend.  Any suggestions as to how
to, for lack of a better word, "clear" the page so that this behavior
is not observed?

thank you!

Luke


- ----- Original Message -----
From: "Jeffery Painter" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, August 20, 2003 5:25 PM
Subject: Re: AW: $link.setAction


>
> You could set the function you want called in your action class in
> a  hidden field.
>
> <form
> name="someform"
> method="post" 
> action="$link.setAction("myclass").setPage("results.vm")">
>
> <input type="hidden" name="eventSubmit_doAdd" value="1"> <input 
> type="hidden" name="otherData" value="1">
>
> <a href="javascript:doSubmit()">Add</a>
>
> </form>
>
> It works just as well as using a form submit element.
>
> You should only pass data and context through the doAdd function,
> use data.getParameters() to pull the otherData variable... these
> variables  will not be passed directly to
>
> doAdd(Rundata data, Context context)
>
> good luck,
> Jeff Painter
>
> On Wed, 20 Aug 2003, Luke Majewski wrote:
>
> > Right, but the problem here is how do I specify what function I
> > want 
called
> > in "myClass" doing it this way.  I don't want a button, I want a 
> > link,
and
> > when I use a link and use the onClick (and submit the form
> > through javascript) it didn't work either.  I'll try a couple
> > other 
> > variations
and
> > get back to everyone about this.
> >
> > Thank you for everyone's help!
> >
> > Luke Majewski
> >
> >
>
>
> --------------------------------------------------------------------
> - To unsubscribe, e-mail:
> turbine-user-unsubscribe@jakarta.apache.org For additional
> commands, e-mail: turbine-user-help@jakarta.apache.org 
>
>



- ---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBP0Ro1WwBrh6aH7CGEQIX3QCeNrKEhWLSrYUnfby8gFbL0CZmqgQAoOhe
PGZLe/KzKjgfM3OvlGYx1shv
=crrF
-----END PGP SIGNATURE-----



Re: AW: $link.setAction

Posted by Luke Majewski <lu...@verizon.net>.
This works _almost_ :)

I like this suggestion it works very well, but now i have the problem that I
have two functions being called by two different links, so I have:

<input type="hidden" name="eventSubmit_doExpand" value="1">
<input type="hidden" name="eventSubmit_doAdd" value="1">

and now what happens is that depending on which link I hit, either the
Expand or the Add, the backend function called will always be the same.  So
in other words, if a vist my page, hit "add", it calls the add function in
my backend.  But then if I hit the "expand" link, it also calls the add
function in my backend.  Any suggestions as to how to, for lack of a better
word, "clear" the page so that this behavior is not observed?

thank you!

Luke


----- Original Message -----
From: "Jeffery Painter" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, August 20, 2003 5:25 PM
Subject: Re: AW: $link.setAction


>
> You could set the function you want called in your action class in a
> hidden field.
>
> <form
> name="someform"
> method="post"
> action="$link.setAction("myclass").setPage("results.vm")">
>
> <input type="hidden" name="eventSubmit_doAdd" value="1">
> <input type="hidden" name="otherData" value="1">
>
> <a href="javascript:doSubmit()">Add</a>
>
> </form>
>
> It works just as well as using a form submit element.
>
> You should only pass data and context through the doAdd function, use
> data.getParameters() to pull the otherData variable... these variables
> will not be passed directly to
>
> doAdd(Rundata data, Context context)
>
> good luck,
> Jeff Painter
>
> On Wed, 20 Aug 2003, Luke Majewski wrote:
>
> > Right, but the problem here is how do I specify what function I want
called
> > in "myClass" doing it this way.  I don't want a button, I want a link,
and
> > when I use a link and use the onClick (and submit the form through
> > javascript) it didn't work either.  I'll try a couple other variations
and
> > get back to everyone about this.
> >
> > Thank you for everyone's help!
> >
> > Luke Majewski
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: AW: $link.setAction

Posted by Luke Majewski <lu...@verizon.net>.
This works _almost_ :)

I like this suggestion it works very well, but now i have the problem that I
have two functions being called by two different links, so I have:

<input type="hidden" name="eventSubmit_doExpand" value="1">
<input type="hidden" name="eventSubmit_doAdd" value="1">

and now what happens is that depending on which link I hit, either the
Expand or the Add, the backend function called will always be the same.  So
in other words, if a vist my page, hit "add", it calls the add function in
my backend.  But then if I hit the "expand" link, it also calls the add
function in my backend.  Any suggestions as to how to, for lack of a better
word, "clear" the page so that this behavior is not observed?

thank you!

Luke


----- Original Message -----
From: "Jeffery Painter" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, August 20, 2003 5:25 PM
Subject: Re: AW: $link.setAction


>
> You could set the function you want called in your action class in a
> hidden field.
>
> <form
> name="someform"
> method="post"
> action="$link.setAction("myclass").setPage("results.vm")">
>
> <input type="hidden" name="eventSubmit_doAdd" value="1">
> <input type="hidden" name="otherData" value="1">
>
> <a href="javascript:doSubmit()">Add</a>
>
> </form>
>
> It works just as well as using a form submit element.
>
> You should only pass data and context through the doAdd function, use
> data.getParameters() to pull the otherData variable... these variables
> will not be passed directly to
>
> doAdd(Rundata data, Context context)
>
> good luck,
> Jeff Painter
>
> On Wed, 20 Aug 2003, Luke Majewski wrote:
>
> > Right, but the problem here is how do I specify what function I want
called
> > in "myClass" doing it this way.  I don't want a button, I want a link,
and
> > when I use a link and use the onClick (and submit the form through
> > javascript) it didn't work either.  I'll try a couple other variations
and
> > get back to everyone about this.
> >
> > Thank you for everyone's help!
> >
> > Luke Majewski
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>



Re: AW: $link.setAction

Posted by Jeffery Painter <pa...@kiasoft.com>.
You could set the function you want called in your action class in a 
hidden field.

	<form 
		name="someform" 
		method="post"		
		action="$link.setAction("myclass").setPage("results.vm")">

		<input type="hidden" name="eventSubmit_doAdd" value="1">
		<input type="hidden" name="otherData" value="1">

		<a href="javascript:doSubmit()">Add</a>

	</form>

It works just as well as using a form submit element.

You should only pass data and context through the doAdd function, use 
data.getParameters() to pull the otherData variable... these variables 
will not be passed directly to 

	doAdd(Rundata data, Context context)

good luck,
Jeff Painter

On Wed, 20 Aug 2003, Luke Majewski wrote:

> Right, but the problem here is how do I specify what function I want called
> in "myClass" doing it this way.  I don't want a button, I want a link, and
> when I use a link and use the onClick (and submit the form through
> javascript) it didn't work either.  I'll try a couple other variations and
> get back to everyone about this.
> 
> Thank you for everyone's help!
> 
> Luke Majewski
> 
> 


Re: AW: $link.setAction

Posted by Jeffery Painter <pa...@kiasoft.com>.
You could set the function you want called in your action class in a 
hidden field.

	<form 
		name="someform" 
		method="post"		
		action="$link.setAction("myclass").setPage("results.vm")">

		<input type="hidden" name="eventSubmit_doAdd" value="1">
		<input type="hidden" name="otherData" value="1">

		<a href="javascript:doSubmit()">Add</a>

	</form>

It works just as well as using a form submit element.

You should only pass data and context through the doAdd function, use 
data.getParameters() to pull the otherData variable... these variables 
will not be passed directly to 

	doAdd(Rundata data, Context context)

good luck,
Jeff Painter

On Wed, 20 Aug 2003, Luke Majewski wrote:

> Right, but the problem here is how do I specify what function I want called
> in "myClass" doing it this way.  I don't want a button, I want a link, and
> when I use a link and use the onClick (and submit the form through
> javascript) it didn't work either.  I'll try a couple other variations and
> get back to everyone about this.
> 
> Thank you for everyone's help!
> 
> Luke Majewski
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: AW: $link.setAction

Posted by Luke Majewski <lu...@verizon.net>.
Right, but the problem here is how do I specify what function I want called
in "myClass" doing it this way.  I don't want a button, I want a link, and
when I use a link and use the onClick (and submit the form through
javascript) it didn't work either.  I'll try a couple other variations and
get back to everyone about this.

Thank you for everyone's help!

Luke Majewski


----- Original Message -----
From: "Jeffery Painter" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, August 20, 2003 7:35 AM
Subject: Re: AW: $link.setAction


>
> 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:luke.majewski@verizon.net]
> > 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" <pa...@kiasoft.com>
> > To: "Turbine Users List" <tu...@jakarta.apache.org>
> > 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: turbine-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>



Re: AW: $link.setAction

Posted by Luke Majewski <lu...@verizon.net>.
Right, but the problem here is how do I specify what function I want called
in "myClass" doing it this way.  I don't want a button, I want a link, and
when I use a link and use the onClick (and submit the form through
javascript) it didn't work either.  I'll try a couple other variations and
get back to everyone about this.

Thank you for everyone's help!

Luke Majewski


----- Original Message -----
From: "Jeffery Painter" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, August 20, 2003 7:35 AM
Subject: Re: AW: $link.setAction


>
> 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:luke.majewski@verizon.net]
> > 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" <pa...@kiasoft.com>
> > To: "Turbine Users List" <tu...@jakarta.apache.org>
> > 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: turbine-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: AW: $link.setAction

Posted by Jeffery Painter <pa...@kiasoft.com>.
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:luke.majewski@verizon.net] 
> 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" <pa...@kiasoft.com>
> To: "Turbine Users List" <tu...@jakarta.apache.org>
> 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: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> > 
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: AW: $link.setAction

Posted by Jeffery Painter <pa...@kiasoft.com>.
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:luke.majewski@verizon.net] 
> 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" <pa...@kiasoft.com>
> To: "Turbine Users List" <tu...@jakarta.apache.org>
> 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: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> > 
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 


AW: $link.setAction

Posted by Jürgen Hoffmann <jh...@byteaction.de>.
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:luke.majewski@verizon.net] 
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" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
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: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 



AW: $link.setAction

Posted by Jürgen Hoffmann <jh...@byteaction.de>.
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:luke.majewski@verizon.net] 
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" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
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: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: $link.setAction

Posted by Luke Majewski <lu...@verizon.net>.
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" <pa...@kiasoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
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: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 

Re: $link.setAction

Posted by Jeffery Painter <pa...@kiasoft.com>.
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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: $link.setAction

Posted by Jeffery Painter <pa...@kiasoft.com>.
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