Override Component#renderHeader(IHeaderResponse response)

and call response.renderOnDomReadyJavascript()

The above assumes wicket 1.5, although this is also possible in 1.4.

OnDomReady javascript code is handled properly for both regular and ajax requests.

Op 10-10-2011 17:27, schreef armandoxxx:
Hey guys.

I've got a little question regarding templates.

I'm creating a javascript chart and a chart needs a container to be drawn
in. To tell my javascript chart library what container to draw a chart in I
use a template.

my template:


my markup file:
<div wicket:id="chart"></div>
<wicket:container wicket:id="javascriptTemplate"></wicket:container>

now to the problem ... on ajax reload this template is added to head of the
page.

and since JS code is executed before my container exists on a page, I get an
error that container is not found.

any workaround for this ?

Regards

Armando


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/W-1-5-templates-added-to-head-on-ajax-reload-tp3890648p3890648.html
Sent from the Users forum mailing list archive at Nabble.com.

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

Reply via email to