@Override public void processAjaxBehavior(AjaxBehaviorEvent event) throws AbortProcessingException { FacesContext context = FacesContext.getCurrentInstance(); final ELContext elContext = context.getELContext(); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Try to invoke listener: " + listener.getExpressionString()); } try { listener.invoke(elContext, new Object[]{}); } catch (MethodNotFoundException | IllegalArgumentException | ArrayIndexOutOfBoundsException mnfe) { processArgListener(context, elContext, event); } }
private void processArgListener(FacesContext context, ELContext elContext, AjaxBehaviorEvent event) throws AbortProcessingException { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Try to invoke listenerWithArg: " + listenerWithArg.getExpressionString()); } try { listenerWithArg.invoke(elContext, new Object[]{event}); } catch (MethodNotFoundException | IllegalArgumentException mnfe) { processCustomArgListener(context, elContext, event); } }
behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl( this.listener.getMethodExpression(ctx, Void.class, EMPTY_PARAMS), this.listener.getMethodExpression(ctx, Void.class, ARG_PARAMS))); behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl( this.listener.getMethodExpression(ctx, Void.class, EMPTY_PARAMS), this.listener.getMethodExpression(ctx, Void.class, ARG_PARAMS),
/** * @see org.pivot4j.analytics.property.PropertyEditor#createComponent(org.pivot4j.analytics.property.PropertyDescriptor, * javax.faces.component.UIComponent, javax.el.ValueExpression, * javax.el.MethodExpression, java.lang.String) */ @Override public void createComponent(PropertyDescriptor descriptor, UIComponent parent, ValueExpression expression, MethodExpression listener, String update) { FacesContext context = FacesContext.getCurrentInstance(); UIInput input = createInput(descriptor, parent, context); input.setValueExpression("value", expression); String eventName = getEventName(); if (eventName != null) { AjaxBehavior behavior = new AjaxBehavior(); behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl( listener, listener)); behavior.setUpdate(update); input.addClientBehavior("change", behavior); } parent.getChildren().add(input); }
behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl( this.listener.getMethodExpression(ctx, Void.class, EMPTY_PARAMS), this.listener.getMethodExpression(ctx, Void.class, ARG_PARAMS))); behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl( this.listener.getMethodExpression(ctx, Void.class, EMPTY_PARAMS), this.listener.getMethodExpression(ctx, Void.class, ARG_PARAMS),
private void processArgListener(FacesContext context, ELContext elContext, AjaxBehaviorEvent event) throws AbortProcessingException { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Try to invoke listenerWithArg: " + listenerWithArg.getExpressionString()); } try { listenerWithArg.invoke(elContext, new Object[]{event}); } catch (MethodNotFoundException mnfe) { processCustomArgListener(context, elContext, event); } catch (IllegalArgumentException e) { processCustomArgListener(context, elContext, event); } }
public void processAjaxBehavior(AjaxBehaviorEvent event) throws AbortProcessingException { FacesContext context = FacesContext.getCurrentInstance(); final ELContext elContext = context.getELContext(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Try to invoke listener: " + listener.getExpressionString()); } try { listener.invoke(elContext, new Object[]{}); } catch (MethodNotFoundException mnfe) { processArgListener(context, elContext, event); } catch (IllegalArgumentException iae) { processArgListener(context, elContext, event); } catch (ArrayIndexOutOfBoundsException ex) { processArgListener(context, elContext, event); } }
behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl( expression, expression)); behavior.setProcess("@this");