You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Angelo C." <an...@gmail.com> on 2010/11/29 02:01:26 UTC

T5: using message prefix in a javascript block

Hi,

How to use message prefix in a javascript? following is sample's
${message:info_text} does not work when inside the script block, any hints?
Thanks,


jQuery(document).ready(function(){
		jQuery("#info_text").watermark(${message:info_text});
});
</script>
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-using-message-prefix-in-a-javascript-block-tp3283837p3283837.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: T5: using message prefix in a javascript block

Posted by "Angelo C." <an...@gmail.com>.
right, turned out this works:

jQuery("#info_text").watermark("${message:info_text}");


Josh Canfield wrote:
> 
> Try looking at the source for the rendered page. It looks like you are
> rendering a string without quotes.
> 
> 

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-using-message-prefix-in-a-javascript-block-tp3283837p3285619.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: T5: using message prefix in a javascript block

Posted by Josh Canfield <jo...@gmail.com>.
Try looking at the source for the rendered page. It looks like you are
rendering a string without quotes.

If you put your script a comment then you'll need to evaluate your tapestry
bindings outside of it and store it in a var.
On 28 Nov 2010 17:01, "Angelo C." <an...@gmail.com> wrote:
>
> Hi,
>
> How to use message prefix in a javascript? following is sample's
> ${message:info_text} does not work when inside the script block, any
hints?
> Thanks,
>
>
> jQuery(document).ready(function(){
> jQuery("#info_text").watermark(${message:info_text});
> });
> </script>
> --
> View this message in context:
http://tapestry.1045711.n5.nabble.com/T5-using-message-prefix-in-a-javascript-block-tp3283837p3283837.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: T5: using message prefix in a javascript block

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Sun, 28 Nov 2010 23:01:26 -0200, Angelo C. <an...@gmail.com>  
wrote:

> Hi,

Hi!

> How to use message prefix in a javascript? following is sample's
> ${message:info_text} does not work when inside the script block, any  
> hints?

Using JavaScript inline (inside templates) is not recommended at all. Use  
RenderSupport (T5.1-) or JavaScriptSupport (T5.2) instead.

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