You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by surajknair <su...@gmail.com> on 2011/03/07 17:53:01 UTC

Passing value of Hidden Field Property to Javascript Function in .tml

Hi Guys,

I have just started working on Tapestry 5.2.0 and there's something I need
information on, probably I am stuck with it.

I am using a hidden field in my .tml which is feeded value from a .js. So
far everything is fine. Now I need to use the value from the hidden field
into an onlick javascript function attched to a button, which will call an
appropriate overlay based on the value passed by the hidden field.

But, the issue is, I am not able to pass the hidden field value, which is a
string property defined in the component(.java) to the javascript function.

I am doing something like this

Hidden Field:


Trying to pass the 'destination' string property value into the javascript
function.
Sumit

Somehow passing the 'destination' into the javascript is not returning the
value in the hidden field. When I do a SOP for the destination property it
does print the value onto the console.

Any suggestions...



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Passing-value-of-Hidden-Field-Property-to-Javascript-Function-in-tml-tp3412730p3412730.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Passing value of Hidden Field Property to Javascript Function in .tml

Posted by Taha Hafeez <ta...@gmail.com>.
Have you annotated destination with @Persist in case it is a form submission
?

regards
Taha



On Mon, Mar 7, 2011 at 11:39 PM, surajknair <su...@gmail.com> wrote:

> javascript:
> This is inside a .js file.
>
> function PreviewOverlay( linkClicked ) {
>
>      if (linkClicked == 'print') {
>
>            $('someformid').linkDestination.value = 'PrintingOverlay';
> //Setting the hidden field value within the form.
>
>            alert($('someformid').linkDestination.value); //To check value
> added of hidden field.
>
>      }
>
>      $('PreviewOverlay').showOverlay();
>
> }
>
>
>
> function showOverlayFrom(linkDestination){
>
>      alert("Hidden Field Value: "+linkDestination); //This is to check
> whether I can get the hidden field value here into another function after
> the form submit.
>
> }
>
>
>
>
>
>
> .tml
>
>
>
>
>
>
>
> Continue //The value in the hidden field will have the value to decide
> which
> overlay to open.
>
>
>
>
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Passing-value-of-Hidden-Field-Property-to-Javascript-Function-in-tml-tp3412730p3412845.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Passing value of Hidden Field Property to Javascript Function in .tml

Posted by surajknair <su...@gmail.com>.
javascript:
This is inside a .js file.

function PreviewOverlay( linkClicked ) {

      if (linkClicked == 'print') {

            $('someformid').linkDestination.value = 'PrintingOverlay';
//Setting the hidden field value within the form.

            alert($('someformid').linkDestination.value); //To check value
added of hidden field.

      } 

      $('PreviewOverlay').showOverlay();

}

 

function showOverlayFrom(linkDestination){

      alert("Hidden Field Value: "+linkDestination); //This is to check
whether I can get the hidden field value here into another function after
the form submit.

}






.tml





              

Continue //The value in the hidden field will have the value to decide which
overlay to open.







--
View this message in context: http://tapestry.1045711.n5.nabble.com/Passing-value-of-Hidden-Field-Property-to-Javascript-Function-in-tml-tp3412730p3412845.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Passing value of Hidden Field Property to Javascript Function in .tml

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 07 Mar 2011 13:53:01 -0300, surajknair <su...@gmail.com>  
wrote:

> Hi Guys,

Hi!

Please post your JavaScript code and template snippet.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org