Re: Expansion for Javascript

2010-07-14 Thread Thiago H. de Paula Figueiredo
On Wed, 14 Jul 2010 15:13:45 -0300, Inge Solvoll wrote: And then you might say "Yeah, but something like this should be built-in". A lot of things should, but there aren't too many Tapestry committers :) Having too many built-in features can be a problem too. Anyway, the recommended wa

Re: Expansion for Javascript

2010-07-14 Thread Josh Canfield
> I still had to do the escaping of the quotation marks myself Take a look at JSONObject.quote(String string); On Wed, Jul 14, 2010 at 10:40 AM, Tim Koop wrote: >  Cool!  It works! > > I still had to do the escaping of the quotation marks myself, but at least > the html encoding doesn't need to

Re: Expansion for Javascript

2010-07-14 Thread Inge Solvoll
Actually, it's quite super easy to create those yourself :) Seriously, very very easy. Have a look at OutputRaw.java in the T5 source, and you'll get the idea. And then you might say "Yeah, but something like this should be built-in". A lot of things should, but there aren't too many Tapestry com

Re: Expansion for Javascript

2010-07-14 Thread Thiago H. de Paula Figueiredo
On Wed, 14 Jul 2010 14:27:07 -0300, Tim Koop wrote: Hi everyone. I've looked through the documentation, but I can't seem to find an answer for what I'm looking for. I want to put a String into Javascript as a variable, like this: var name = "${name}"; The recommended and less error-

Re: Expansion for Javascript

2010-07-14 Thread Tim Koop
Cool! It works! I still had to do the escaping of the quotation marks myself, but at least the html encoding doesn't need to be undone first. (Now if only there was outputjsstring, outputurl, outputtextarea, outputcsv, and outputcustom) Tim Koop t...@timkoop.com

Re: Expansion for Javascript

2010-07-14 Thread Michael Gentry
Actually, that would have an issue if your name had a single quote in it. You might have to use a hidden form value (hopefully you have a form?). There is a bug in the Tapestry hidden component, though, so you have to do some tricks. Something like ... Then using Prototype in your JavaScri

Re: Expansion for Javascript

2010-07-14 Thread Michael Gentry
Assuming your example is in your TML file, try: var name=''; mrg On Wed, Jul 14, 2010 at 1:27 PM, Tim Koop wrote: >  Hi everyone. > > I've looked through the documentation, but I can't seem to find an answer > for what I'm looking for. > > I want to put a String into Javascript as a variable,