Package javax.faces.component

Examples of javax.faces.component.UIViewRoot.addPhaseListener()


        catch (Exception ex)
        {
            throw new JspException(ex.getMessage(), ex);
        }

        root.addPhaseListener(listener);

        return SKIP_BODY;

    }
View Full Code Here


        b = this.binding.getValueExpression(ctx, PhaseListener.class);
      }

      PhaseListener pl = new LazyPhaseListener(this.listenerType, b);

      root.addPhaseListener(pl);
    }
  }
}
View Full Code Here

                throw new JspException(e.getMessage(), e.getCause());
            }
        } else {
            listener = new BindingPhaseListener(type, binding);           
        }
        viewRoot.addPhaseListener(listener);

        return (SKIP_BODY);

    }
View Full Code Here

    if (null != viewIdHolder && viewIdHolder.skipNavigation(viewId)) {
      viewIdHolder.setViewId(viewId);
      riRoot = facesContext.getViewRoot();
    } else {
      riRoot = super.createView(facesContext, viewId);
      riRoot.addPhaseListener(new RenderPhaseComponentListener());
      // Reset ajax request status for a navigation case.
      if(null != facesContext.getViewRoot()){
        ajaxContext.setAjaxRequest(false);
      }
    }
View Full Code Here

            listener = new BindingPhaseListener(binding, type);
        } catch(Exception ex) {
            throw new JspException(ex.getMessage(),ex);
        }

        root.addPhaseListener(listener);

        return SKIP_BODY;

    }
View Full Code Here

            PhaseListenerBean pl1 = new PhaseListenerBean(id);
            PhaseListenerBean pl2 = new PhaseListenerBean(id);
            facesContext.getExternalContext().getRequestMap().put("bean", bean);
            root.setBeforePhaseListener(beforeExpression);
            root.setAfterPhaseListener(afterExpression);
            root.addPhaseListener(pl1);
            root.addPhaseListener(pl2);

            // validate behavior
            callRightLifecycleMethodGivenPhaseId(root, id);
            assertTrue(bean.isBeforePhaseCalled());
View Full Code Here

            PhaseListenerBean pl2 = new PhaseListenerBean(id);
            facesContext.getExternalContext().getRequestMap().put("bean", bean);
            root.setBeforePhaseListener(beforeExpression);
            root.setAfterPhaseListener(afterExpression);
            root.addPhaseListener(pl1);
            root.addPhaseListener(pl2);

            // validate behavior
            callRightLifecycleMethodGivenPhaseId(root, id);
            assertTrue(bean.isBeforePhaseCalled());
            assertTrue(!bean.isAfterPhaseCalled());
View Full Code Here

            pl1 = new PhaseListenerBean(id, true, false);
            pl2 = new PhaseListenerBean(id);
            facesContext.getExternalContext().getRequestMap().put("bean", bean);
            root.setBeforePhaseListener(beforeExpression);
            root.setAfterPhaseListener(afterExpression);
            root.addPhaseListener(pl1);
            root.addPhaseListener(pl2);

            // validate behavior
            callRightLifecycleMethodGivenPhaseId(root, id);
            assertTrue(bean.isBeforePhaseCalled());
View Full Code Here

            pl2 = new PhaseListenerBean(id);
            facesContext.getExternalContext().getRequestMap().put("bean", bean);
            root.setBeforePhaseListener(beforeExpression);
            root.setAfterPhaseListener(afterExpression);
            root.addPhaseListener(pl1);
            root.addPhaseListener(pl2);

            // validate behavior
            callRightLifecycleMethodGivenPhaseId(root, id);
            assertTrue(bean.isBeforePhaseCalled());
            assertTrue(bean.isAfterPhaseCalled());
View Full Code Here

            // special handling for UIViewRoot since ComponentHandler.isNew()
            // will always return true
            if (parent instanceof UIViewRoot) {
                List<PhaseListener> listeners = root.getPhaseListeners();
                if (!listeners.contains(pl)) {
                    root.addPhaseListener(pl);
                }
            } else {
                root.addPhaseListener(pl);
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.