@Override public void addAjaxBehaviorListener(AjaxBehaviorListener listener) { getWrapped().addAjaxBehaviorListener(listener); }
@Override public void addAjaxBehaviorListener(AjaxBehaviorListener listener) { getWrapped().addAjaxBehaviorListener(listener); }
@Override public void addAjaxBehaviorListener(AjaxBehaviorListener listener) { getWrapped().addAjaxBehaviorListener(listener); }
@Override public void addAjaxBehaviorListener(AjaxBehaviorListener listener) { getWrapped().addAjaxBehaviorListener(listener); }
@Override public void addAjaxBehaviorListener(AjaxBehaviorListener listener) { getWrapped().addAjaxBehaviorListener(listener); }
AjaxBehavior ajaxBehavior = new AjaxBehavior(); MethodExpression methodExpression = FacesUtil.createMethodExpression( "#{formerpmain.onTabChange}", void.class, new Class<?>[]{}); ajaxBehavior.addAjaxBehaviorListener( new AjaxBehaviorListenerImpl(methodExpression)); ajaxBehavior.setListener(methodExpression); ajaxBehavior.setProcess("@parent");
/** * Create an ajax behavior which should invoke an ajax listener method expression based on the given EL expression. * The target method must take an {@link AjaxBehaviorEvent} as argument. * As an example, the following ajax listener example, * <ul> * <li><code>public void ajaxListener(AjaxBehaviorEvent event)</code></li> * </ul> * <p>can be created as follows: * <ul> * <li><code>createAjaxBehavior("#{bean.ajaxListener}");</code></li> * </ul> * <p>Note that this is essentially the programmatic equivalent of <code><f:ajax></code>. So if you intented * to create for example a <code><p:ajax></code> programmatically, then don't use this method. * @param expression The EL expression to be invoked when the created ajax behavior is processed. * @return The created ajax behavior, ready to be used as * {@link UIComponentBase#addClientBehavior(String, ClientBehavior)} whereby the string argument represents the * client event name, such as "action", "valueChange", "click", "blur", etc. */ public static AjaxBehavior createAjaxBehavior(String expression) { FacesContext context = FacesContext.getCurrentInstance(); AjaxBehavior behavior = (AjaxBehavior) context.getApplication().createBehavior(AjaxBehavior.BEHAVIOR_ID); MethodExpression method = createVoidMethodExpression(expression, AjaxBehaviorEvent.class); behavior.addAjaxBehaviorListener(event -> method.invoke(getELContext(), new Object[] { event })); return behavior; }
/** * Create an ajax behavior which should invoke an ajax listener method expression based on the given EL expression. * The target method must take an {@link AjaxBehaviorEvent} as argument. * As an example, the following ajax listener example, * <ul> * <li><code>public void ajaxListener(AjaxBehaviorEvent event)</code></li> * </ul> * <p>can be created as follows: * <ul> * <li><code>createAjaxBehavior("#{bean.ajaxListener}");</code></li> * </ul> * <p>Note that this is essentially the programmatic equivalent of <code><f:ajax></code>. So if you intented * to create for example a <code><p:ajax></code> programmatically, then don't use this method. * @param expression The EL expression to be invoked when the created ajax behavior is processed. * @return The created ajax behavior, ready to be used as * {@link UIComponentBase#addClientBehavior(String, ClientBehavior)} whereby the string argument represents the * client event name, such as "action", "valueChange", "click", "blur", etc. */ public static AjaxBehavior createAjaxBehavior(String expression) { FacesContext context = FacesContext.getCurrentInstance(); AjaxBehavior behavior = (AjaxBehavior) context.getApplication().createBehavior(AjaxBehavior.BEHAVIOR_ID); MethodExpression method = createVoidMethodExpression(expression, AjaxBehaviorEvent.class); behavior.addAjaxBehaviorListener(event -> method.invoke(getELContext(), new Object[] { event })); return behavior; }
ajaxBehaviour.addAjaxBehaviorListener( new AjaxBehaviorListenerImpl( ajaxListener ) );
ajaxBehaviour.addAjaxBehaviorListener( new AjaxBehaviorListenerImpl( ajaxListener ) );
private AjaxBehavior createAjaxBehavior(FaceletContext ctx, String eventName) { Application application = ctx.getFacesContext().getApplication(); AjaxBehavior behavior = (AjaxBehavior)application.createBehavior( AjaxBehavior.BEHAVIOR_ID); setBehaviorAttribute(ctx, behavior, this.onevent, String.class); setBehaviorAttribute(ctx, behavior, this.onerror, String.class); setBehaviorAttribute(ctx, behavior, this.disabled, Boolean.class); setBehaviorAttribute(ctx, behavior, this.immediate, Boolean.class); setBehaviorAttribute(ctx, behavior, this.resetValues, Boolean.class); setBehaviorAttribute(ctx, behavior, this.execute, Object.class); setBehaviorAttribute(ctx, behavior, this.render, Object.class); setBehaviorAttribute(ctx, behavior, this.delay, String.class); if (null != listener) { behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl( this.listener.getMethodExpression(ctx, Object.class, new Class[] { AjaxBehaviorEvent.class }), this.listener.getMethodExpression(ctx, Object.class, new Class[] { }))); } return behavior; }
private AjaxBehavior createAjaxBehavior(FaceletContext ctx, String eventName) { Application application = ctx.getFacesContext().getApplication(); AjaxBehavior behavior = (AjaxBehavior)application.createBehavior( AjaxBehavior.BEHAVIOR_ID); setBehaviorAttribute(ctx, behavior, this.onevent, String.class); setBehaviorAttribute(ctx, behavior, this.onerror, String.class); setBehaviorAttribute(ctx, behavior, this.disabled, Boolean.class); setBehaviorAttribute(ctx, behavior, this.immediate, Boolean.class); setBehaviorAttribute(ctx, behavior, this.resetValues, Boolean.class); setBehaviorAttribute(ctx, behavior, this.execute, Object.class); setBehaviorAttribute(ctx, behavior, this.render, Object.class); setBehaviorAttribute(ctx, behavior, this.delay, String.class); if (null != listener) { behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl( this.listener.getMethodExpression(ctx, Object.class, new Class[] { AjaxBehaviorEvent.class }), this.listener.getMethodExpression(ctx, Object.class, new Class[] { }))); } return behavior; }
private AjaxBehavior createAjaxBehavior(FaceletContext ctx, String eventName) { Application application = ctx.getFacesContext().getApplication(); AjaxBehavior behavior = (AjaxBehavior)application.createBehavior( AjaxBehavior.BEHAVIOR_ID); setBehaviorAttribute(ctx, behavior, this.onevent, String.class); setBehaviorAttribute(ctx, behavior, this.onerror, String.class); setBehaviorAttribute(ctx, behavior, this.disabled, Boolean.class); setBehaviorAttribute(ctx, behavior, this.immediate, Boolean.class); setBehaviorAttribute(ctx, behavior, this.resetValues, Boolean.class); setBehaviorAttribute(ctx, behavior, this.execute, Object.class); setBehaviorAttribute(ctx, behavior, this.render, Object.class); setBehaviorAttribute(ctx, behavior, this.delay, String.class); if (null != listener) { behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl( this.listener.getMethodExpression(ctx, Object.class, new Class[] { AjaxBehaviorEvent.class }), this.listener.getMethodExpression(ctx, Object.class, new Class[] { }))); } return behavior; }
private AjaxBehavior createAjaxBehavior(FaceletContext ctx, String eventName) { Application application = ctx.getFacesContext().getApplication(); AjaxBehavior behavior = (AjaxBehavior)application.createBehavior( AjaxBehavior.BEHAVIOR_ID); setBehaviorAttribute(ctx, behavior, this.onevent, String.class); setBehaviorAttribute(ctx, behavior, this.onerror, String.class); setBehaviorAttribute(ctx, behavior, this.disabled, Boolean.class); setBehaviorAttribute(ctx, behavior, this.immediate, Boolean.class); setBehaviorAttribute(ctx, behavior, this.resetValues, Boolean.class); setBehaviorAttribute(ctx, behavior, this.execute, Object.class); setBehaviorAttribute(ctx, behavior, this.render, Object.class); setBehaviorAttribute(ctx, behavior, this.delay, String.class); if (null != listener) { behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl( this.listener.getMethodExpression(ctx, Object.class, new Class[] { AjaxBehaviorEvent.class }), this.listener.getMethodExpression(ctx, Object.class, new Class[] { }))); } return behavior; }
((javax.faces.component.behavior.AjaxBehavior) clientBehavior).addAjaxBehaviorListener( new SelectDetailLevelListener(me));
faceletContext, Void.TYPE, AJAX_BEHAVIOR_LISTENER_SIG); AjaxBehaviorListener abl = new AjaxBehaviorListenerImpl(expr); ajaxBehavior.addAjaxBehaviorListener(abl);
faceletContext, Void.TYPE, AJAX_BEHAVIOR_LISTENER_SIG); AjaxBehaviorListener abl = new AjaxBehaviorListenerImpl(expr); ajaxBehavior.addAjaxBehaviorListener(abl);
faceletContext, Void.TYPE, AJAX_BEHAVIOR_LISTENER_SIG); AjaxBehaviorListener abl = new AjaxBehaviorListenerImpl(expr); ajaxBehavior.addAjaxBehaviorListener(abl);