Package javax.faces.event

Examples of javax.faces.event.FacesEvent


    /**
         * @param phaseEventsQueue
         * @param havePhaseEvents
         */
    public void processEvents(EventsQueue phaseEventsQueue, boolean havePhaseEvents) {
  FacesEvent event;
  while (havePhaseEvents) {
      try {
    event = (FacesEvent) phaseEventsQueue.remove();
    UIComponent source = event.getComponent();
    try {
        source.broadcast(event);
    } catch (AbortProcessingException e) {
        // abort event processing
        // Page 3-30 of JSF 1.1 spec: "Throw an
View Full Code Here


    public void broadcast(FacesEvent event) throws AbortProcessingException {
        makeAlias();

        if (event instanceof FacesEventWrapper) {
            FacesEvent originalEvent = ((FacesEventWrapper) event).getWrappedFacesEvent();
            originalEvent.getComponent().broadcast(originalEvent);
        } else {
            super.broadcast(event);
        }

        removeAlias();
View Full Code Here

        if (event instanceof FacesEventWrapper)
        {
            FacesEventWrapper childEvent = (FacesEventWrapper) event;
            String currNodeId = getNodeId();
            setNodeId(childEvent.getNodeId());
            FacesEvent nodeEvent = childEvent.getFacesEvent();
            nodeEvent.getComponent().broadcast(nodeEvent);
            setNodeId(currNodeId);
            return;
        } else
        {
            super.broadcast(event);
View Full Code Here

  public void broadcast(FacesEvent event) throws AbortProcessingException
  {
    if (event instanceof FacesEventWrapper)
    {
      FacesEvent originalEvent = ((FacesEventWrapper) event).getWrappedFacesEvent();
      int eventRowIndex = ((FacesEventWrapper) event).getRowIndex();
      int currentRowIndex = getRowIndex();
      setRowIndex(eventRowIndex);
      originalEvent.getComponent().broadcast(originalEvent);
      setRowIndex(currentRowIndex);
    }
    else
    {
      super.broadcast(event);
View Full Code Here

        boolean abort = false;

        int phaseIdOrdinal = phaseId.getOrdinal();
        for (ListIterator listiterator = _events.listIterator(); listiterator.hasNext();)
        {
            FacesEvent event = (FacesEvent) listiterator.next();
            int ordinal = event.getPhaseId().getOrdinal();
            if (ordinal == ANY_PHASE_ORDINAL ||
                ordinal == phaseIdOrdinal)
            {
                UIComponent source = event.getComponent();
                try
                {
                    source.broadcast(event);
                }
                catch (AbortProcessingException e)
View Full Code Here

    if (event instanceof TableRowEvent)
    {
      TableRowEvent rowEvent = (TableRowEvent) event;
      Object old = getRowKey();
      setRowKey(rowEvent.getCurrencyKey());
      FacesEvent wrapped = rowEvent.getEvent();
      wrapped.getComponent().broadcast(wrapped);
      setRowKey(old);
    }
    else
    {
      super.broadcast(event);
View Full Code Here

    {
        assert events != null;

        for (int i = 0; i < events.size(); i++)
        {
            FacesEvent event = events.get(i);
            UIComponent source = event.getComponent();
            UIComponent compositeParent = UIComponent.getCompositeComponentParent(source);
            if (compositeParent != null)
            {
                pushComponentToEL(context, compositeParent);
            }
View Full Code Here

        List<FacesEvent> anyPhase = new ArrayList<FacesEvent>(size);
        List<FacesEvent> onPhase = new ArrayList<FacesEvent>(size);
       
        for (int i = 0; i < size; i++)
        {
            FacesEvent event = _events.get(i);
            if (event.getPhaseId().equals(PhaseId.ANY_PHASE))
            {
                anyPhase.add(event);
                _events.remove(i);
                size--;
                i--;
            }
            else if (event.getPhaseId().equals(phaseId))
            {
                onPhase.add(event);
                _events.remove(i);
                size--;
                i--;
View Full Code Here

     * Test method for {@link javax.faces.component.UIData#broadcast(javax.faces.event.FacesEvent)}.
     */
    public void testBroadcastFacesEvent()
    {
        // create event mock
        final FacesEvent originalEvent = _mocksControl.createMock(FacesEvent.class);
       
        // create the component for the event
        UIComponent eventComponent = new UICommand()
        {

            @Override
            public void broadcast(FacesEvent event)
                    throws AbortProcessingException
            {
                // the event must be the originalEvent
                assertEquals(originalEvent, event);
               
                // the current row index must be the row index from the time the event was queued
                assertEquals(5, _testImpl.getRowIndex());
               
                // the current component must be this (pushComponentToEL() must have happened)
                assertEquals(this, UIComponent.getCurrentComponent(facesContext));
               
                // to be able to verify that broadcast() really has been called
                getAttributes().put("broadcastCalled", Boolean.TRUE);
            }
           
        };
       
        // set component on event
        EasyMock.expect(originalEvent.getComponent()).andReturn(eventComponent).anyTimes();
        // set phase on event
        EasyMock.expect(originalEvent.getPhaseId()).andReturn(PhaseId.INVOKE_APPLICATION).anyTimes();
        _mocksControl.replay();
       
        // set PhaseId for event processing
        facesContext.setCurrentPhaseId(PhaseId.INVOKE_APPLICATION);
        // set row index for event
View Full Code Here

    @Override
    public void broadcast(FacesEvent event) throws AbortProcessingException
    {
        if (event instanceof FacesEventWrapper)
        {
            FacesEvent originalEvent = ((FacesEventWrapper) event).getWrappedFacesEvent();
            int eventRowIndex = ((FacesEventWrapper) event).getRowIndex();
            final int currentRowIndex = getRowIndex();
            UIComponent source = originalEvent.getComponent();
            UIComponent compositeParent = UIComponent.getCompositeComponentParent(source);

            setRowIndex(eventRowIndex);
            if (compositeParent != null)
            {
View Full Code Here

TOP

Related Classes of javax.faces.event.FacesEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.