Re: W 1.5: templates added to head on ajax reload ...

2011-10-11 Thread armandoxxx
thank you guys for your replies ! 

Regards

Armando

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/W-1-5-templates-added-to-head-on-ajax-reload-tp3890648p3893138.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



W 1.5: templates added to head on ajax reload ...

2011-10-10 Thread 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



Re: W 1.5: templates added to head on ajax reload ...

2011-10-10 Thread Bas Gooren

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



Re: W 1.5: templates added to head on ajax reload ...

2011-10-10 Thread Martin Grigorov
Replace wicket:container with div.
wicket:xyz are not normal DOM nodes and later Ajax functionality
cannot find such component for replacement.

On Mon, Oct 10, 2011 at 6:27 PM, armandoxxx armando@dropchop.com wrote:
 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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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