Can you share the code ?

regards
Taha

On Thu, Jul 14, 2011 at 5:38 AM, iberck <ibe...@gmail.com> wrote:
>
> Taha Hafeez wrote:
>>
>> By using JSONLiteral you are sending the value without quotes. But the
>> problem is how your value is interpreted by javascript. A string
>> literal without quotes will be interpreted as a variable and as that
>> variable is not defined you will get an error.
>>
>> Can you share the actual code ?
>>
>> regards
>> Taha
>>
>> On Thu, Jul 14, 2011 at 4:53 AM, iberck &lt;ibe...@gmail.com&gt; wrote:
>>>
>>> I'm using
>>> Taha Hafeez wrote:
>>> >
>>> > Hi
>>> >
>>> > When you specify something as a JSONLiteral, it is displayed as is and
>>> no
>>> > quotes are applied. So the JSON is your case becomes
>>> >
>>> > { strkey: strvalue}
>>> >
>>> > so javascript tries to find the variable strvalue which is not there.
>>> >
>>> > When you don't specify JSONLiteral, JSON is
>>> >
>>> > {strkey : "strvalue"}
>>> >
>>> > which is fine.
>>> >
>>> >  Have you debugged it in firebug or chrome, it may be showing undefined
>>> > variable or something
>>> >
>>> > regards
>>> > Taha
>>> >
>>> > On Thu, Jul 14, 2011 at 1:46 AM, iberck &lt;ibe...@gmail.com&gt; wrote:
>>> >
>>> >> When I send the JSONObject: jsSupport.addInitializerCall("test1",
>>> >> jobj.toCompactString()); IT WORKS
>>> >>
>>> >> Thanks in advance ;)
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://tapestry.1045711.n5.nabble.com/T5-2-6-JSONLiteral-Bug-tp4584187p4584206.html
>>> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>> >>
>>> >
>>>
>>> Thank you for your response Taha, I need the format {"key": value}
>>> because
>>> I'm using JQPlot library and it requires that json format
>>>
>>> Do you know are there another way to send the value from Tapestry without
>>> quotes ?
>>> I'm fixing the bug sending the json as compacted string and then breaking
>>> it
>>> in javascript :S
>>>
>>> Thank you
>>>
>>>
>>> --
>>> View this message in context:
>>> http://tapestry.1045711.n5.nabble.com/T5-2-6-JSONLiteral-Bug-tp4584187p4584672.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>
>
> Yes I was sending the Strings as JSONLiteral but when I do it, Tapestry
> doesn't executes the javascript function...
> I'm frustrated because much of my code uses JSON. My actual code basically
> sends JSONLiteral's inside a JSONObject like the above example but it
> doesn't work by a Tapestry bug, I'm trying a version downgrade :(
> I've trying disabling SymbolConstants.COMPACT_JSON but it doesn't work
>
> Thank you for your responses
>
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/T5-2-6-JSONLiteral-Bug-tp4584187p4584751.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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

Reply via email to