You are confusing JavaScript objects, instantiated in the browser,
with JSON, a protocol for transferring data between client and server.
By design, JSON is a subset of JavaScript, specifically for security
(and performance) reasons.

You are floundering on the idea that you can push something composed
entirely on the server and execute it directly in the browser. That's
not what you are allowed to do (and note that the JSONLiteral business
is a hack that, as you can see, breaks things unexpectedly).

Send JSON of your own design to the client, let client code compose
the options object passed to the API you are using. That is the
Tapestry way, that is the best approach.

You don't see this is bespoke applications, because bespoke
applications don't have to deal with composability the way reusable
components do.

On Tue, Oct 23, 2012 at 2:55 AM, bhorvat <horvat.z.bo...@gmail.com> wrote:
> François Facon-3 wrote
>> I guess your parser error is due to jQuery which reject function even
>> received from ajax call. I've encountered the problem with the plugin
>> Jeditable.
>> see the following commit
>>
>> https://github.com/got5/tapestry5-jquery/commit/818ae2a5594397ea7368237d081e40b2fa3edbbe
>>
>> As Thiago mentioned, this should be considered as a hack.
>> In your case, I guess it would be better to follow howard's
>> recommendation.
>> - load a plugin during render phase (mixin could do that)
>> - configure your plugin to listen to an event etc..
>
> Yea I have found the line in the Jquery itself that fails when parsing the
> JSON with the native call. So I guess there is nothing that can be done
> about this.
>
> Still though I am not sure why this approach would be consider a hack. The
> autocomplete plugin expects to get a function that should handle certain
> events, and passing JSON is a way to pass information to the plugin. It is
> the same as passing the configuration parameters such as "title" : "My
> title". So I would expect that the tapestry's (in this case
> tapestry5-jquery) implementation of the plugin handles all configuration
> that can be passed to the plugin, and not just the normal parameters.
>
> If I understood correctly what I should do is create a mixing that will be
> loaded the autocomplete during the rendering page and then pass the function
> as I have done so far because in that case it will have the function before
> I need to refresh the zone to reveal the automcomplete textfield?
>
>
>
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/JSONLiteral-breaks-zone-refresh-tapesty-jquery-tp5717101p5717166.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
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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

Reply via email to