wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@apache.org>
Subject Re: AjaxFallbackLink does not work on Windows Mobile Internet Explorer
Date Thu, 03 Dec 2009 10:28:01 GMT
Richard Wilkinson wrote:
> Actually I've just realiaed, you can't remove the behaviour with component
> instansiation because it hasn't been added yet. Look at
> ibeforeonbeforerenderlistener. Its called something like that, can't check
> at the moment.

Thank you, you've been very helpful. This code did the trick:

> addPostComponentOnBeforeRenderListener( new IComponentOnBeforeRenderListener() {
> 	@Override
> 	public void onBeforeRender( Component component ) {
> 		List<IBehavior> behaviors = component.getBehaviors();
> 		for ( IBehavior behavior : behaviors ) {
> 			if ( AjaxEventBehavior.class.isAssignableFrom( behavior.getClass() ) ) {
> 				AjaxEventBehavior aeb = (AjaxEventBehavior) behavior;
> 				if ( aeb.getEvent().equalsIgnoreCase( "onclick" ) )
> 					component.remove( behavior );
> 			}
> 		}
> 	}
> } );

works like a charm.
	
	lg
	
-- 
Leszek Gawron                              http://lgawron.blogspot.com

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


Mime
View raw message