I understand that wicket-4200 (no prepended javascript in
onBeforeRender()) is marked fixed in 1.5.3. I pulled the latest SNAPSHOT
to see if I could get an early fix. It may be that the current snapshot
is known to be unstable in this regard, but prepending javascript still
does not work. I've been told it does, but it really does not and you
may want to check this out. I added these lines to an ajax target...

 

      StringBuilder prependBuilder;

      StringBuilder appendBuilder;

 

      prependBuilder = new StringBuilder("var outerDijit =
dijit.byId('").append(dojoComponent.getMarkupId()).append("');")

        .append("if (outerDijit)
{outerDijit.destroyDescendants();outerDijit.destroyRecursive();")

 
.append("dojo.byId('").append(dojoComponent.getDijitContainerMarkupId())
.append("').id='").append(dojoComponent.getMarkupId()).append("'}");

 

      appendBuilder = new
StringBuilder("dojo.parser.parse(dojo.byId('").append(dojoComponent.getD
ijitContainerMarkupId()).append("'));");

 

      target.prependJavaScript("alert('boofaz');");

      target.prependJavaScript(prependBuilder);

      target.appendJavaScript(appendBuilder);

 

Really, most of this code does not matter. Just note that the first bit
of javascript is the simple alert('boofaz') (why 'boofaz', why not?).
The resulting return has this as the first priority-evaluate...

 

<priority-evaluate><![CDATA[alert('boofaz');]]></priority-evaluate>

 

...but no alert is ever produced. However, it's clear from the results
of the ajax return that the regular evaluate sections are run. So
something is wrong with the latest wicket-ajax.js.

 

David

Reply via email to