On Wed, 26 Jun 2013 14:51:29 -0300, D.R. <d.re...@googlemail.com> wrote:

whoops,

usually i declare my components in the page class, but in this project i
wanted to write less code. I've checked the docs about expansions and
this topic is now clear to me, thank you Thiago for your answer and your
hint.

:)


You was right, i don't get this error anymore, but it still don't work
properly:

.tml:
<t:jquery.jgrowl params="jgrowlparams" />

.java:
    public JSONObject getJgrowlParams()
    {
        JSONObject retour = new JSONObject();
        retour.put("position", "center");
        retour.put("header", "Error");
        retour.put("beforeClose", "function(e,m) {alert('About to close
this notification!');}");
        return retour;
    }

I guess you should use JSONLiteral when passing the function. Otherwise, it'll be treated as an ordinary string. Please try this and let us know the result.

A mostly unrelated hint: instead of passing a function inside a JSONObject, why don't you create this function in some .js file and just pass it directly? Something like function myBeforeClose() {...} in a .js file and then retour.put("beforeClose", "myBeforeClose"). I haven't tested it, but it may work. Either way, the less JS code you have in Java classes, putting them on .js files instead, the better.

--
Thiago H. de Paula Figueiredo

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

Reply via email to