Execute Javascript after Ajax

2011-05-26 Thread Phil Franken

Here are my components;
Wicket 1.4.17
Page
AjaxTabbedPanel (with Panel1 and Panel2)
AdPanel which has adsense js, no components
AdPanel is on Panel1 and Panel2

When the tab panel renders the first tab (Panel1) the AdPanel executes 
its js and renders the ad.  Moving to the second tab (Panel2) the 
AdPanel executes its js (I know becuase i added an alert) but does NOT 
render the ad.  And moving back to the first tab, the ad that was 
previously shown fails to render.


Note: behavior as described is for IE and Chrome, Firefox fails to 
render the page altogether.  IE and Chrome at least render the page and 
panel without the ad.


I've also tried adding the js to a function (in AdPanel markup) and 
calling that function on dom load with a behavior.  As well as the 
response.renderOnDomReadyJavascript() and 
response.renderJavascriptReference() but this renders to head.


I've also tried an AjaxLazyLoadPanel for AdPanel with no effect, the ad 
renders once and only before an Ajax call.


Is there any way to execute the js inline after an ajax call?  Am I 
missing something, are there Ajax bugs here?



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



Re: Execute Javascript after Ajax

2011-05-26 Thread Igor Vaynberg
target.appendJavascript(js) will execute it after components have
been updated via ajax.

-igor

On Thu, May 26, 2011 at 6:12 PM, Phil Franken phil.fran...@gmail.com wrote:
 Here are my components;
 Wicket 1.4.17
 Page
 AjaxTabbedPanel (with Panel1 and Panel2)
 AdPanel which has adsense js, no components
 AdPanel is on Panel1 and Panel2

 When the tab panel renders the first tab (Panel1) the AdPanel executes its
 js and renders the ad.  Moving to the second tab (Panel2) the AdPanel
 executes its js (I know becuase i added an alert) but does NOT render the
 ad.  And moving back to the first tab, the ad that was previously shown
 fails to render.

 Note: behavior as described is for IE and Chrome, Firefox fails to render
 the page altogether.  IE and Chrome at least render the page and panel
 without the ad.

 I've also tried adding the js to a function (in AdPanel markup) and calling
 that function on dom load with a behavior.  As well as the
 response.renderOnDomReadyJavascript() and
 response.renderJavascriptReference() but this renders to head.

 I've also tried an AjaxLazyLoadPanel for AdPanel with no effect, the ad
 renders once and only before an Ajax call.

 Is there any way to execute the js inline after an ajax call?  Am I missing
 something, are there Ajax bugs here?


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



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