Package javax.faces.event

Examples of javax.faces.event.AbortProcessingException


            }
            if (instance == null && this.type != null) {
                try {
                    instance = (L) TagHandlerUtils.loadClass(this.type, Object.class).newInstance();
                } catch (Exception e) {
                    throw new AbortProcessingException("Couldn't Lazily instantiate EventListener", e);
                }
                if (this.binding != null) {
                    binding.setValue(faces.getELContext(), instance);
                }
            }
View Full Code Here


        @Override
        protected void process(UIComponent kid, ComponentProcessingContext cpContext)
        {
          if (UIXComponent.visitTree(noColumnFacetContext, kid, visitCallback))
          {
            throw new AbortProcessingException();
          }
        }
      };
    }
    else
    {
      // We are only visiting a subset of the tree, so figure out which rows to visit

      String ourClientIdPrefix = getClientId(visitContext.getFacesContext());

      int subtreeIdCount = subtreeIds.size();

      // build up a set of the row keys to visit rather than iterating
      // and visiting every row
      Set<String> rowsToVisit;

      if (subtreeIdCount > 1)
      {
        rowsToVisit = new HashSet<String>(subtreeIdCount);

        for (String currClientId : subtreeIds)
        {
          String clientToken = _getClientToken(ourClientIdPrefix, currClientId);

          if (clientToken != null)
          {
            rowsToVisit.add(clientToken);
          }
        }
      }
      else
      {
        String clientToken = _getClientToken(ourClientIdPrefix,
                                             subtreeIds.iterator().next());

        if (clientToken != null)
        {
          rowsToVisit = Collections.singleton(clientToken);
        }
        else
        {
          rowsToVisit = Collections.emptySet();
        }
      }

      // we didn't visit any data
      if (rowsToVisit.isEmpty())
        return false;

      // visit only the rows we need to
      runner = new KeyedRunner(rowsToVisit)
      {
        @Override
        protected void process(
          UIComponent                kid,
          ComponentProcessingContext cpContext
          ) throws IOException
        {
          if (UIXComponent.visitTree(noColumnFacetContext, kid, visitCallback))
          {
            throw new AbortProcessingException();
          }
        }
      };
    }
View Full Code Here

                {
                    phasesInstance = ClassUtils.newInstance((String)type.getValue(currentFacesContext.getELContext()));
                }
                catch (FacesException ex)
                {
                    throw new AbortProcessingException(ex.getMessage(), ex);
                }
            }
            return (PhaseListener)phasesInstance;

        }
View Full Code Here

    populateRegionCombo();
  }
   
  public void saveNewUser(){
    if(!validate()){
      throw new AbortProcessingException(ERROR_MESG);
    }
    else {
      this.userDAO.saveNewUser(user)
    }
  }
View Full Code Here

    if (methodExpression != null && event != null) {
      try {
        methodExpression.invoke(facesContext.getELContext(), new Object[]{event});
      } catch (Exception e) {
        throw new AbortProcessingException(e);
      }
    }
  }
View Full Code Here

                // The spec wording is poor but, to keep this coherently with ExceptionHandler API, the spec and code on UIViewRoot we need:
                // 2a) "exception is instance of APE or any of the causes of the exception are an APE,
                // DON'T publish ExceptionQueuedEvent and terminate processing for current event".
                // 2b) for any other exception publish ExceptionQueuedEvent and continue broadcast processing.
                Throwable cause = e.getCause();
                AbortProcessingException ape = null;
                if (cause != null)
                {
                    do
                    {
                        if (cause != null && cause instanceof AbortProcessingException)
View Full Code Here

                {
                    phasesInstance = ClassUtils.newInstance((String)type.getValue(currentFacesContext.getELContext()));
                }
                catch (FacesException ex)
                {
                    throw new AbortProcessingException(ex.getMessage(), ex);
                }
            }
            return (PhaseListener)phasesInstance;

        }
View Full Code Here

        UICommand button = (UICommand) root.findComponent("mainForm:button1");
        Assert.assertNotNull(button);
       
        ExceptionBean bean = EasyMock.createMock(ExceptionBean.class);
        EasyMock.expect(bean.doSomeAction()).andThrow(new AbortProcessingException());
        // Setup is finished need to activate the mock
        EasyMock.replay(bean);
               
        request.setAttribute("bean", bean);
               
View Full Code Here

        Assert.assertNotNull(button);
       
        //ActionEvent event = new ActionEvent(button);
        ExceptionBean bean = EasyMock.createMock(ExceptionBean.class);
        bean.doSomeActionListener((ActionEvent)EasyMock.anyObject());
        EasyMock.expectLastCall().andThrow(new AbortProcessingException());
        // Setup is finished need to activate the mock
        EasyMock.replay(bean);
               
        request.setAttribute("bean", bean);
               
View Full Code Here

            public void invokeContextCallback(FacesContext context, UIComponent target)
            {
                Object submittedValue = "Hello!";
                ExceptionBean bean = EasyMock.createStrictMock(ExceptionBean.class);
                bean.valueChangeListenerMe((ValueChangeEvent)EasyMock.anyObject());
                EasyMock.expectLastCall().andThrow(new AbortProcessingException());
                // Setup is finished need to activate the mock
                EasyMock.replay(bean);
               
                request.setAttribute("bean", bean);
               
View Full Code Here

TOP

Related Classes of javax.faces.event.AbortProcessingException

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.