Not aware of that, sorry. In my window component, I hack to replace double quote of all function to empty. JSONObject options= new JSONObject(); options.put("showEffect", "TO_BE_REPLACE" + this.showEffect+"TO_BE_REPLACE");
getPageRenderSupport().addScript("%s = new Window(%s);", getUniqueId(), filterJsFunction(options.toString())); private String filterJsFunction(String jsonString) { // function begin jsonString = jsonString.replaceAll("\"TO_BE_REPLACE", ""); // function end jsonString = jsonString.replaceAll("TO_BE_REPLACE\"", ""); return jsonString; } Well, a bit stupid, but works. DH ----- Original Message ----- From: "Francois Armand" <farm...@linagora.com> To: "Tapestry users" <users@tapestry.apache.org> Sent: Monday, March 09, 2009 9:51 PM Subject: Re: Tapestry JSONObject : no 'function' type, any workaround ? > ningdh wrote: >> toString method of JsonObject would double quote our value. >> One way is to create some data type extends jsonobject to encapsule your >> data and override the toString method. I haven't tried it yet. >> > > But JSONObject and JSONArray are final, that's not possible - it was my > first plan. How can I workaround that ? > > > -- > Francois Armand > Etudes & Développements J2EE > Groupe Linagora - http://www.linagora.com > Tél.: +33 (0)1 58 18 68 28 > ----------- > http://fanf42.blogspot.com > InterLDAP - http://interldap.org > FederID - http://www.federid.org/ > Open Source identities management and federation > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >