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: [email protected]
For additional commands, e-mail: [email protected]