1 Reply Latest reply on Mar 10, 2015 11:41 AM by ddadlani

    Are Nested navigations supported?

    pnakaska

      GIven a typical pattern (below) for setting up a navigation, where in a main panel there is a header, content, and footer, and the content is annotated @NavigationPanel. The content is replaced when transitionTo() is used, but the header and footer remain, as desired.

      However consider a case where the content panel is comprised of a left panel and a  right panel. Is is possible to replace Just the right panel, say, and leave the left panel, using much the same mechanism as the navigation, considering the content panel it's in is already a navigable content panel?

      public class MainPage extends Composite

      {

        @Inject  private Navigation navigation;

        @Inject @DataField  private FooterPanel footer;

        @Inject  @DataField  @NavigationPanel  private SimplePanel content;

       

        @PostConstruct

        private void initInstance()

        {

          RootPanel.get().add(this);

          RootPanel.get().add(footer);

        }

      }


      Need to know how to structure the  'content' panel as a panel that contains two panels,  using navigation (recursively?) to replace the right panel, is this possible?

      Is nested navigation possible?

        • 1. Re: Are Nested navigations supported?
          ddadlani

          Hello Philip,

           

          There is no explicit support for nesting Navigations, mainly because we cannot currently create a bookmarkable URL for the nested navigation pages.


          However, you can mock this behaviour by inserting the left panel as a widget into the content, and keeping the left panel unchanged whenever you navigate to a new page. So while the entire content panel changes when you navigate, the same left panel shows up every time, and it appears as though only the right panel is changed.


          If you are using this behaviour to create a sidebar and content panel, for example, you can also always use nested lists in your sidebar to navigate to sub-pages in the right content panel.

           

          Hope this helps. If this doesn't work for your use case, feel free to explain it further and we will try to help you.

           

          Cheers,
          Divya