@Override
 public void queueEvent(FacesEvent event) {
   if ((event instanceof ItemChangeEvent) && (event.getComponent() == this)) {
     setEventPhase((ItemChangeEvent) event);
   }
   super.queueEvent(event);
 }
 @Override
 public void broadcast(FacesEvent event) {
   super.broadcast(event);
   if (this.equals(event.getComponent()) && event instanceof FormChageEvent) {
     MethodExpression listener = (MethodExpression) getAttributes().get("listener");
     if (listener != null) {
       listener.invoke(FacesContext.getCurrentInstance().getELContext(), null);
     }
   }
 }
Exemple #3
0
 @Override
 public void broadcast(FacesEvent event) throws AbortProcessingException {
   if (event instanceof IndexedEvent) {
     IndexedEvent indexedEvent = (IndexedEvent) event;
     Integer eventIndex = indexedEvent.getIndex();
     Integer currentIndex = getIndex();
     try {
       setIndex(eventIndex);
       FacesEvent originalEvent = indexedEvent.getOriginalEvent();
       originalEvent.getComponent().broadcast(originalEvent);
     } finally {
       this.setIndex(currentIndex);
     }
   } else {
     super.broadcast(event);
   }
 }
Exemple #4
0
 @Override
 public void broadcast(FacesEvent event) {
   if (event instanceof AliasEvent) {
     FacesContext context = getFacesContext();
     AliasVariableMapper alias = getAliasVariableMapper(context);
     try {
       AliasVariableMapper.exposeAliasesToRequest(context, alias);
       FacesEvent origEvent = ((AliasEvent) event).getOriginalEvent();
       origEvent.getComponent().broadcast(origEvent);
     } finally {
       if (alias != null) {
         AliasVariableMapper.removeAliasesExposedToRequest(context, alias.getId());
       }
     }
   } else {
     super.broadcast(event);
   }
 }
  @Override
  public void queueEvent(FacesEvent event) {
    if (event instanceof ActionEvent) {
      if (event.getComponent() == this) {
        if (isImmediate()) {
          event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
        } else if (isBypassUpdates()) {
          event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
        } else {
          event.setPhaseId(PhaseId.INVOKE_APPLICATION);
        }
      }

      // UICommand set Phase ID for all ActionEvents - bypass it.
      getParent().queueEvent(event);
    } else {
      super.queueEvent(event);
    }
  }
  public void broadcast(FacesContext context) throws AbortProcessingException {
    // Set up the correct context and fire our wrapped event
    UIDataAdaptor dataAdaptor = getComponent();
    initialRowKey = dataAdaptor.getRowKey();

    UIComponent compositeParent = null;

    UIComponent targetComponent = event.getComponent();

    try {
      if (!UIComponent.isCompositeComponent(targetComponent)) {
        compositeParent = UIComponent.getCompositeComponentParent(targetComponent);
      }

      if (compositeParent != null) {
        compositeParent.pushComponentToEL(context, null);
      }

      setupEventContext(context);

      targetComponent.pushComponentToEL(context, null);
      targetComponent.broadcast(event);
    } finally {
      try {
        dataAdaptor.setRowKey(context, initialRowKey);
      } catch (Exception e) {
        LOGGER.error(e.getMessage(), e);
      }

      initialRowKey = null;

      targetComponent.popComponentFromEL(context);

      if (compositeParent != null) {
        compositeParent.popComponentFromEL(context);
      }
    }
  }