It doesn't work for me.
In java :
@IncludeJavaScriptLibrary({ context:static/javascript/address.js })
@Environmental
private RenderSupport renderSupport;
@BeginRender
void addJsLibs() {
log.debug(BEGIN addJsLibs);
JSONObject jsonObject = new JSONObject();
in address.js remove the last call to loadAddresse. i.e. just have
Tapestry.Initializer.loadAddresse = function loadAddresse(jsonObject){
...
}
it is probably that last surplus : loadAddresse(jsonObject); that
caused the JS error ('cos there is no global function called
loadAddresse) which then
I found why it didn't work. I just replaced:
Tapestry.Initializer.load = function loadPass(jsonObject){
}
with
Tapestry.Initializer.loadPass = function loadPass(jsonObject){
...
}
I believed that 'load' was a maethod to call on Tapestry.Initializer
object(unfortunately T API says
It didn't work:
Oups ... org.apache.tapestry5.runtime.ComponentEventException: A component
event handler method returned the value
MultiZoneUpdate[{page=org.apache.tapestry5.corelib.components.Zone@1799a64,
May it's because in the javascript file the call to the load fucntion is
made lie that:
On Wed, 28 Dec 2011 14:40:12 -0200, Javix s.camb...@gmail.com wrote:
In javascript, I just replaced arguments by jsonObject:
function load(jsonObject){
...
//acces to the variable in JSON
errorText.text(jsonObject.m2)
}
Why in case of JSON it DOES NOT WORK ?
From the addInit() JavaDoc,
I have a strange behavior when usin the above methods to add javascript from
inside Java classes.
When I use the first one like this:
//java class
@Inject
private Messages messages;
@Environmental
private RenderSupport renderSupport;
@BeginRender
void addJsLibs() {