Package javax.faces.event

Examples of javax.faces.event.PreRenderComponentEvent


    @Override
    public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
        super.processEvent(event);
        if (event instanceof PreRenderViewEvent) {
            Renderer renderer = getRenderer(getFacesContext());
            ((ComponentSystemEventListener) renderer).processEvent(new PreRenderComponentEvent(this));
        }
    }
View Full Code Here


    @Override
    public void processEvent(SystemEvent event) throws AbortProcessingException {
        if (event instanceof PreRenderViewEvent) {
            Renderer renderer = getRenderer(getFacesContext());
            if (renderer instanceof ComponentSystemEventListener) {
                ((ComponentSystemEventListener) renderer).processEvent(new PreRenderComponentEvent(this));
            }
        }
    }
View Full Code Here

  }

  @Test
  public void shouldCapturePreRenderComponentEvent() throws Exception {
    UIComponent component = mock(UIComponent.class);
    SystemEvent event = new PreRenderComponentEvent(component);
    this.listener.processEvent(event);
    assertThat(MvcNavigationSystemEventListener.getLastPreRenderComponentEvent(this.context),
        is(sameInstance(event)));
  }
View Full Code Here

  }

  @Override
  public NavigationCase getNavigationCase(FacesContext context, String fromAction, String outcome) {
    if (SpringFacesContext.getCurrentInstance() != null) {
      PreRenderComponentEvent preRenderComponentEvent = MvcNavigationSystemEventListener
          .getLastPreRenderComponentEvent(context);
      UIComponent component = (preRenderComponentEvent == null ? null : preRenderComponentEvent.getComponent());
      String defaultDestinationViewId = getDefaultDestinationViewId(context, fromAction, outcome);
      NavigationContext navigationContext = new NavigationContextImpl(fromAction, outcome, true, component,
          defaultDestinationViewId);
      if (this.navigationOutcomeResolver.canResolve(context, navigationContext)) {
        try {
View Full Code Here

  @Test
  public void shouldObtainComponentFromPreRenderComponentEvent() throws Exception {
    NavigationOutcome outcome = new NavigationOutcome(new Object());
    UIComponent component = mock(UIComponent.class);
    PreRenderComponentEvent preRenderComponentEvent = new PreRenderComponentEvent(component);
    DestinationAndModel dam = new DestinationAndModel(outcome, preRenderComponentEvent);
    assertThat(dam.getComponent(), is(sameInstance(component)));
  }
View Full Code Here

        fireAndAssert("19", new PreRemoveFromViewEvent(component));
    }

    @Test
    public void testObservePreRenderComponent() {
        fireAndAssert("20", new PreRenderComponentEvent(component));
    }
View Full Code Here

        fireAndAssert("20", new PreRenderComponentEvent(component));
    }

    @Test
    public void testObservePreRenderComponentComponent() {
        fireAndAssert("21", new PreRenderComponentEvent(component));
    }
View Full Code Here

TOP

Related Classes of javax.faces.event.PreRenderComponentEvent

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.