Class ViewNavigators

java.lang.Object
io.jmix.flowui.ViewNavigators

@Component("flowui_ViewNavigators") public class ViewNavigators extends Object
Provides fluent interface for navigating to views.
  • Field Details

  • Constructor Details

  • Method Details

    • detailView

      public <E> DetailViewNavigator<E> detailView(Class<E> entityClass)
      Creates a detail view navigator for an entity class.

      Example of navigating to a view for editing an entity:

      
       viewNavigators.detailView(Customer.class)
               .editEntity(customersTable.getSingleSelectedItem())
               .withViewClass(CustomerDetailView.class)
               .navigate();
       

      Example of navigating to a view for creating a new entity instance:

      
       viewNavigators.detailView(Customer.class)
               .newEntity()
               .withViewClass(CustomerDetailView.class)
               .navigate();
       
      Parameters:
      entityClass - edited entity class
    • detailView

      public <E> DetailViewNavigator<E> detailView(ListDataComponent<E> listDataComponent)
      Creates a detail view navigator to edit an entity selected in the list component.
      Parameters:
      listDataComponent - the component which provides a selected entity to edit
      See Also:
    • detailView

      public <E> DetailViewNavigator<E> detailView(EntityPickerComponent<E> picker)
      Creates a detail view navigator to edit an entity selected in the picker component.
      Parameters:
      picker - the component which provides an entity to edit
      See Also:
    • listView

      public <E> ListViewNavigator<E> listView(Class<E> entityClass)
      Creates a list view navigator for an entity class.

      Example of navigating to a view for editing an entity and returning to the calling view:

      
       viewNavigators.listView(Customer.class)
               .withViewClass(CustomerListView.class)
               .withBackwardNavigation(true)
               .navigate();
       
      Parameters:
      entityClass - edited entity class
    • view

      public ViewNavigator view(Class<? extends View> viewClass)
      Creates a view navigator.
      Parameters:
      viewClass - class of the view to navigate to
    • view

      public ViewNavigator view(String viewId)
      Creates a view navigator.
      Parameters:
      viewId - id of the view to navigate to (as set in the ViewController annotation)
    • getBeanType

      protected <E> Class<E> getBeanType(ListDataComponent<E> listDataComponent)
    • getBeanType

      protected <E> Class<E> getBeanType(EntityPickerComponent<E> picker)