What if the function already existed on some global object?

What if the JSONObject you pass in is not passed directly to autocommit code?

So you pass what I call a "spec", and it builds the options for the
autocommit itself.  You don't specify a function, you specify a
function name or reference.

I'm not exactly sure why the Ajax case fails; I suspect something in
the Prototype portion of the pipeline is sanitizing the JSONObject to
defeat what you are attempting. I always start in the Network tab, to
see exactly what is being passed down to the client (I sometimes use
curl from the command line just to be certain there isn't some browser
caching getting in the way).

On Sun, Oct 21, 2012 at 2:27 AM, bhorvat <horvat.z.bo...@gmail.com> wrote:
> Hi,
>
> I have already wrote about a problem I was having in 2 different treads and
> I was finally able to figure out the solution for that. My problem was that
> I needed to pass the function to the autocomplete mixin.
>
>     public JSONObject getAutoUsersParams() {
>         JSONObject params = new JSONObject();
>         params.put("select", new JSONLiteral("function (event,ui)
> {alert(1)}"));
>         return params;
>     }
>
> I pass this to the t:options of the autocomponent mixing and that is it. The
> problem now is that I have button that switches the edit mode on and off
> using the zones. And that doesnt work any more. If I am in the edit mode and
> I click back it does what is suppose to. However if i am not in the edit
> mode and it needs to initilzed the autocomponent using the code above...well
> nothing happens.
>
> Does anyone know why is this and how can I fix it?
>
> If I remove the JSONLiteral it all works great, so I am guessing that the
> problem is in the unquted literal that is passed when the zone is refreshed
> (which I have to do), but I am not sure why it is broken.
>
> Also I dont get any errors about this. Not in Chrome not in output.
>
> Any ideas would be appreciated
>
>
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/JSONLiteral-breks-zone-refresh-tp5717101.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