Package javax.faces.event

Examples of javax.faces.event.ComponentSystemEvent


        bean.invokePostAddToViewEvent(EasyMock.isA(ComponentSystemEvent.class));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>()
        {
            public Object answer()
            {
                ComponentSystemEvent e = (ComponentSystemEvent) EasyMock
                        .getCurrentArguments()[0];
                Assert.assertTrue(e.getComponent() instanceof UIForm);
                Assert.assertEquals(PhaseId.RENDER_RESPONSE, facesContext.getCurrentPhaseId());
                return null;
            }
        }).once();
        EasyMock.replay(bean);
        //Put on request map
        request.setAttribute("postAddToViewEventBean", bean);
        processLifecycleExecuteAndRender();
        EasyMock.verify(bean);
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:submit");
        client.submit(button);
       
        bean = EasyMock.createMock(PostAddToViewEventBean.class);
        bean.invokePostAddToViewEvent(EasyMock.isA(ComponentSystemEvent.class));
        // With PSS PostAddToViewEvent is called again on restore view phase
        // but when building initial state.
        if (WebConfigParamUtils.getBooleanInitParameter(externalContext, StateManager.PARTIAL_STATE_SAVING_PARAM_NAME))
        {
            EasyMock.expectLastCall().andAnswer(new IAnswer<Object>()
            {
                public Object answer()
                {
                    ComponentSystemEvent e = (ComponentSystemEvent) EasyMock
                            .getCurrentArguments()[0];
                    Assert.assertTrue(e.getComponent() instanceof UIForm);
                    Assert.assertEquals(PhaseId.RESTORE_VIEW, facesContext.getCurrentPhaseId());
                    Assert.assertTrue(facesContext.getAttributes().containsKey("javax.faces.IS_BUILDING_INITIAL_STATE"));
                    Assert.assertFalse(FaceletViewDeclarationLanguage.isRefreshingTransientBuild(facesContext));
                    return null;
                }
View Full Code Here


        bean.invokePostAddToViewEvent(EasyMock.isA(ComponentSystemEvent.class));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>()
        {
            public Object answer()
            {
                ComponentSystemEvent e = (ComponentSystemEvent) EasyMock
                        .getCurrentArguments()[0];
                Assert.assertTrue(e.getComponent() instanceof UIPanel);
                Assert.assertEquals(PhaseId.RENDER_RESPONSE, facesContext.getCurrentPhaseId());
                return null;
            }
        }).once();
        EasyMock.replay(bean);
View Full Code Here

        bean.invokePostAddToViewEvent(EasyMock.isA(ComponentSystemEvent.class));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>()
        {
            public Object answer()
            {
                ComponentSystemEvent e = (ComponentSystemEvent) EasyMock
                        .getCurrentArguments()[0];
                Assert.assertTrue(e.getComponent() instanceof UIViewRoot);
                Assert.assertEquals(PhaseId.RENDER_RESPONSE, facesContext.getCurrentPhaseId());
                return null;
            }
        }).once();
        EasyMock.replay(bean);
        //Put on request map
        request.setAttribute("postAddToViewEventBean", bean);
        processLifecycleExecuteAndRender();
        EasyMock.verify(bean);
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:submit");
        submit(button);
       
        bean = EasyMock.createMock(PostAddToViewEventBean.class);
        bean.invokePostAddToViewEvent(EasyMock.isA(ComponentSystemEvent.class));
        // With PSS PostAddToViewEvent is called again on restore view phase
        // but when building initial state.
        if (WebConfigParamUtils.getBooleanInitParameter(externalContext, StateManager.PARTIAL_STATE_SAVING_PARAM_NAME))
        {
            EasyMock.expectLastCall().andAnswer(new IAnswer<Object>()
            {
                public Object answer()
                {
                    ComponentSystemEvent e = (ComponentSystemEvent) EasyMock
                            .getCurrentArguments()[0];
                    Assert.assertTrue(e.getComponent() instanceof UIViewRoot);
                    Assert.assertEquals(PhaseId.RESTORE_VIEW, facesContext.getCurrentPhaseId());
                    Assert.assertTrue(facesContext.getAttributes().containsKey("javax.faces.IS_BUILDING_INITIAL_STATE"));
                    Assert.assertFalse(FaceletViewDeclarationLanguage.isRefreshingTransientBuild(facesContext));
                    return null;
                }
View Full Code Here

        bean.invokePostAddToViewEvent(EasyMock.isA(ComponentSystemEvent.class));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>()
        {
            public Object answer()
            {
                ComponentSystemEvent e = (ComponentSystemEvent) EasyMock
                        .getCurrentArguments()[0];
                Assert.assertTrue(e.getComponent() instanceof UIForm);
                Assert.assertEquals(PhaseId.RENDER_RESPONSE, facesContext.getCurrentPhaseId());
                return null;
            }
        }).once();
        EasyMock.replay(bean);
        //Put on request map
        request.setAttribute("postAddToViewEventBean", bean);
        processLifecycleExecuteAndRender();
        EasyMock.verify(bean);
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:submit");
        submit(button);
       
        bean = EasyMock.createMock(PostAddToViewEventBean.class);
        bean.invokePostAddToViewEvent(EasyMock.isA(ComponentSystemEvent.class));
        // With PSS PostAddToViewEvent is called again on restore view phase
        // but when building initial state.
        if (WebConfigParamUtils.getBooleanInitParameter(externalContext, StateManager.PARTIAL_STATE_SAVING_PARAM_NAME))
        {
            EasyMock.expectLastCall().andAnswer(new IAnswer<Object>()
            {
                public Object answer()
                {
                    ComponentSystemEvent e = (ComponentSystemEvent) EasyMock
                            .getCurrentArguments()[0];
                    Assert.assertTrue(e.getComponent() instanceof UIForm);
                    Assert.assertEquals(PhaseId.RESTORE_VIEW, facesContext.getCurrentPhaseId());
                    Assert.assertTrue(facesContext.getAttributes().containsKey("javax.faces.IS_BUILDING_INITIAL_STATE"));
                    Assert.assertFalse(FaceletViewDeclarationLanguage.isRefreshingTransientBuild(facesContext));
                    return null;
                }
View Full Code Here

        bean.invokePostAddToViewEvent(EasyMock.isA(ComponentSystemEvent.class));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>()
        {
            public Object answer()
            {
                ComponentSystemEvent e = (ComponentSystemEvent) EasyMock
                        .getCurrentArguments()[0];
                Assert.assertTrue(e.getComponent() instanceof UIPanel);
                Assert.assertEquals(PhaseId.RENDER_RESPONSE, facesContext.getCurrentPhaseId());
                return null;
            }
        }).once();
        EasyMock.replay(bean);
View Full Code Here

     *      to signal to listeners that the {@link Task}s needed by this
     *      <code>DeferredFragment</code> have completed and it is now ready to
     *      be processed.</p>
     */
    protected void fireFragmentReadyEvent() {
  ComponentSystemEvent event = new FragmentReadyEvent(this);
System.out.println("listeners" + listeners);
  for (ComponentSystemEventListener listener : listeners) {
      listener.processEvent(event);
  }
    }
View Full Code Here

TOP

Related Classes of javax.faces.event.ComponentSystemEvent

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.