You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "simon.robins" <si...@mac.com> on 2003/05/01 22:01:56 UTC

Re: Javascript: How to send value to server

document.location.href = "${URL}&sp=new&sp=" + tree.getSelected().UUID

${URL} is passed to the javascript via a parameter

If you check out ExternalService it show how urls are constructed.

Your method is perfectly valid. I just prefer this way when a form 
isn't neccessary as it's slightly more effecient. (No rewind required).

On Wednesday, April 30, 2003, at 01:33  pm, F.R. Da Costa Gomez wrote:

> Hmm, fair enough but how would you fill the parameters="" attibute of 
> the @DirectLink with the values "new' and "uuid"?
> The "new" is known but the uuid (as you would guess) will be 
> determined by selection of the user and obtained via JS.
> In the JS function I can create a new Array(2) and fill [0] and [1] 
> with resp."new" and tree.getSelected().UUID but how do you send this 
> structure to the server if the parameters attribute does NOT appear to 
> exist in the rendered page.
>
> Note that the parameters can only be filled from the client.
>
> Cheers,
> Fermin
>
> simon.robins wrote:
>
>> Horses for courses.
>>
>> I tend to use Direct or External link for this sort of stuff as forms 
>> need a rewind phase.
>>
>> On Tuesday, April 29, 2003, at 04:34  pm, F.R. Da Costa Gomez wrote:


Re: Javascript: How to send value to server

Posted by "F. Da Costa Gomez" <dc...@fixed.com>.
Thx a mill for the idea.
I'm nor sure whether the following was what you meant but this is how I 
implemented it
<a href="#" name="addChoice" onclick="this.href=this.href+'&sp='+ 
tree.getSelected().UUID;" jwcid="@DirectLink" 
listener="ognl:listeners.choiceActionListener" parameters="new" >Add 
category</a>

As you can see I utilised your suggestion but in a slightly different 
manner. I couldn't get to the href of the link from a seperate 
js-function (if there is a way I would rather use that though).
Granted I have to copy the code a couple of times but after a couple of 
days of struggling I am :-)        to be able to continue.

Thx again,
Cheers,
Fermin


simon.robins wrote:

> document.location.href = "${URL}&sp=new&sp=" + tree.getSelected().UUID
>
> ${URL} is passed to the javascript via a parameter
>
> If you check out ExternalService it show how urls are constructed.
>
> Your method is perfectly valid. I just prefer this way when a form 
> isn't neccessary as it's slightly more effecient. (No rewind required).
>
> On Wednesday, April 30, 2003, at 01:33  pm, F.R. Da Costa Gomez wrote:
>
>> Hmm, fair enough but how would you fill the parameters="" attibute of 
>> the @DirectLink with the values "new' and "uuid"?
>> The "new" is known but the uuid (as you would guess) will be 
>> determined by selection of the user and obtained via JS.
>> In the JS function I can create a new Array(2) and fill [0] and [1] 
>> with resp."new" and tree.getSelected().UUID but how do you send this 
>> structure to the server if the parameters attribute does NOT appear 
>> to exist in the rendered page.
>>
>> Note that the parameters can only be filled from the client.
>>
>> Cheers,
>> Fermin
>>
>> simon.robins wrote:
>>
>>> Horses for courses.
>>>
>>> I tend to use Direct or External link for this sort of stuff as 
>>> forms need a rewind phase.
>>>
>>> On Tuesday, April 29, 2003, at 04:34  pm, F.R. Da Costa Gomez wrote:
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>