On Tue, 25 Feb 2014 21:30:39 -0300, Boris Horvat <horvat.z.bo...@gmail.com> wrote:

Sorry Thaigo, but I am not sure what you had in mind.
If you think about
That's something to avoid as much as possible.

I wasn't clear. I meant to say you should avoid passing a whole function definition. Just passing a function value (in JavaScript, functions are objects as any other) is something trivial. Just declare the function in some .js file included by your component, mixin or page and pass its reference (its name) to the parameter.

Well first I am not sure why is this the case. If tapestry supports
passing configurations in this way then it should support passing functions when those configurations are expecting them.

Tapestry already does. That's JSONLiteral. In your case, params.put("onSubmit", new JSONLiteral("showUploadProgress"));. Notice there's no parenthesis, so you're passing the function itself, not the result of calling it.

I was able to identify the scenario that leads to this problem. The
ajaxUpload component needs to be surrounded by the zone, if that is not the case then a function can be passed without any issues.
Sadly in my code the zone is necessary.

So you're blaming Tapestry when the culprit isn't actually Tapestry, but a third-party component which expects a Zone event handler return and you may be trying to use it in a way it wasn't supposed. The error you posted earlier in this thread means something wrong went on the server side.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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

Reply via email to