Package javax.faces.application

Examples of javax.faces.application.ConfigurableNavigationHandler


   {

      /*
       * GIVEN a parent navigation handler that knows about a specific view
       */
      ConfigurableNavigationHandler parent = mock(ConfigurableNavigationHandler.class);
      FacesContext facesContext = mock(FacesContext.class);
      NavigationCase navigationCase = mock(NavigationCase.class);
      when(parent.getNavigationCase(facesContext, "something", "/viewId.xhtml")).thenReturn(navigationCase);

      /*
       * WHEN RewriteNavigationHandler processes a redirect outcome created by Navigate class
       */
      RewriteNavigationHandler handler = new RewriteNavigationHandler(parent);
View Full Code Here


        NavigationHandler nh = facesContext.getApplication().getNavigationHandler();
        if (!(nh instanceof ConfigurableNavigationHandler))
        {
            throw new FacesException("navigation handler must be instance of ConfigurabeNavigationHandler for use h:link or h:button");
        }
        ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) nh;
       
        //fromAction is null because there
        NavigationCase navigationCase = navigationHandler.getNavigationCase(facesContext, null, href);

        // when navigation case is null, force the "link" to be rendered as text
        if (navigationCase == null)
        {
            return null;
View Full Code Here

        {
            throw new FacesException(
                    "Navigation handler must be an instance of "
                            + "ConfigurableNavigationHandler for using h:link or h:button");
        }
        ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) nh;
        // fromAction is null because there is no action method that was called to get the outcome
        NavigationCase navigationCase = navigationHandler.getNavigationCase(
                facesContext, null, outcome);
        // when navigation case is null, force the link or button to be disabled and log a warning
        if (navigationCase == null)
        {
            // log a warning
View Full Code Here

        {
            throw new FacesException(
                    "Navigation handler must be an instance of "
                            + "ConfigurableNavigationHandler for using h:link or h:button");
        }
        ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) nh;
        // fromAction is null because there is no action method that was called to get the outcome
        NavigationCase navigationCase = navigationHandler.getNavigationCase(
                facesContext, null, outcome);
        // when navigation case is null, force the link or button to be disabled and log a warning
        if (navigationCase == null)
        {
            // log a warning
View Full Code Here

        {
            throw new FacesException(
                    "Navigation handler must be an instance of "
                            + "ConfigurableNavigationHandler for using h:link or h:button");
        }
        ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) nh;
        // fromAction is null because there is no action method that was called to get the outcome
        NavigationCase navigationCase = navigationHandler.getNavigationCase(
                facesContext, null, outcome);
        // when navigation case is null, force the link or button to be disabled and log a warning
        if (navigationCase == null)
        {
            // log a warning
View Full Code Here

        {
            throw new FacesException(
                    "Navigation handler must be an instance of "
                            + "ConfigurableNavigationHandler for using h:link or h:button");
        }
        ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) nh;
        // fromAction is null because there is no action method that was called to get the outcome
        NavigationCase navigationCase = navigationHandler.getNavigationCase(
                facesContext, null, outcome);
        // when navigation case is null, force the link or button to be disabled and log a warning
        if (navigationCase == null)
        {
            // log a warning
View Full Code Here

                // where the top-level NavigationHandler may be custom and delegates
                // to the default NavigationHandler implementation.  In 1.2, they
                // could be guaranteed that the default implementation had all
                // defined navigation mappings.
                if (navHandler instanceof ConfigurableNavigationHandler) {
                    ConfigurableNavigationHandler cnav = (ConfigurableNavigationHandler) navHandler;
                    Set<NavigationCase> cases = cnav.getNavigationCases().get(fromViewId);
                    if (cases == null) {
                        cases = new LinkedHashSet<NavigationCase>();
                        cnav.getNavigationCases().put(fromViewId, cases);
                    }
                    cases.add(cnc);
                }
                associate.addNavigationCase(cnc);
               
View Full Code Here

  {
    String id;
    id = ToolBean.getRequestParameter("id");
    FacesContext fc = FacesContext.getCurrentInstance();
    NavigationHandler nh = fc.getApplication().getNavigationHandler();
      ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) nh;

          NavigationCase navCase = navigationHandler.getNavigationCase(fc, null,"DataTable.xhtml?id"+id);
   
    return navCase.getToViewId(fc);
  }
View Full Code Here

        FacesContext context = FacesContext.getCurrentInstance();

        NavigationHandler handler = context.getApplication().getNavigationHandler();

        if (handler instanceof ConfigurableNavigationHandler) {
            ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) handler;

            demo = getCurrentDemo().getId();
            sample = getCurrentSample().getId();

            NavigationCase navCase = navigationHandler.getNavigationCase(context, null, "/richfaces" + SEPARATOR
                    + getCurrentDemo().getId() + SEPARATOR + getCurrentSample().getId());

            if (navCase == null) {
                navCase = new NavigationCase("/index.xhtml", null, null, null, "/richfaces/ajax/ajax.xhtml", null, false,
                        true);
View Full Code Here

        NavigationHandler nh = facesContext.getApplication().getNavigationHandler();
        if (!(nh instanceof ConfigurableNavigationHandler)) {
            throw new FacesException("Navigation handler must be an instance of " +
                    "ConfigurableNavigationHandler for using h:link or h:button");
        }
        ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) nh;
        // fromAction is null because there is no action method that was called to get the outcome
        NavigationCase navigationCase = navigationHandler.getNavigationCase(facesContext, null, outcome);

        // when navigation case is null, force the link or button to be disabled and log a warning
        if (navigationCase == null)
        {
            // log a warning
View Full Code Here

TOP

Related Classes of javax.faces.application.ConfigurableNavigationHandler

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.