You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by armandoxxx <ar...@dropchop.com> on 2011/10/10 17:27:42 UTC

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

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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


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

Posted by armandoxxx <ar...@dropchop.com>.
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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


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

Posted by Martin Grigorov <mg...@apache.org>.
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 <ar...@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



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

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


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

Posted by Bas Gooren <ba...@iswd.nl>.
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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>