On Sat, 15 Feb 2014 16:25:27 -0200, Boris Horvat <horvat.z.bo...@gmail.com> wrote:

Hi everyone,

Hi!

I have a tapestr5-jquery component that to which I need to pass a function in the configuration.

That's something to avoid as much as possible.

The component is
http://tapestry5-jquery.com/components/docsajaxupload;jsessionid=2CD857F51B90113A175C5B10EE09B138.57B580630AEA

My code looks like this

java

public JSONObject getUploadParams() {
        JSONObject params = new JSONObject();
        params.put("onSubmit", new
JSONLiteral(String.format("showUploadProgress()")));
        return params;
    }

Your code has an useless String.format() call. In addition, it's passing the value resulting of calling showUploadProgress(), not passing the function itself. It should have been new JSONLiteral("showUploadProgress").

--
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