Class NavigationToolbar

    • Constructor Detail

      • NavigationToolbar

        public NavigationToolbar​(DataTable<?,​?> table)
        Constructor
        Parameters:
        table - data table this toolbar will be attached to
    • Method Detail

      • newPagingNavigator

        protected PagingNavigator newPagingNavigator​(String navigatorId,
                                                     DataTable<?,​?> table)
        Factory method used to create the paging navigator that will be used by the datatable
        Parameters:
        navigatorId - component id the navigator should be created with
        table - dataview used by datatable
        Returns:
        paging navigator that will be used to navigate the data table
      • newNavigatorLabel

        protected WebComponent newNavigatorLabel​(String navigatorId,
                                                 DataTable<?,​?> table)
        Factory method used to create the navigator label that will be used by the datatable. Use newComplexNavigatorLabel(String, IPageableItems) instead if you want to override label with a more complex component.
        Parameters:
        navigatorId - component id navigator label should be created with
        table - DataTable used by datatable
        Returns:
        navigator label that will be used to navigate the data table
      • newComplexNavigatorLabel

        protected Component newComplexNavigatorLabel​(String navigatorId,
                                                     IPageableItems table)
        Factory method used to create the navigator component in place of label that will be used by the datatable. This method takes precedence over newNavigatorLabel(String, DataTable). By default it returns null. NOTE: This is just a HACK to not break API in wicket 9.x and support use case of a more complex component as label. In wicket 10.x we will simply change the return type of NavigationToolbar#newNavigatorLabel(String, DataTable).
        Parameters:
        navigatorId - component id navigator label should be created with
        table - DataTable used by label
        Returns:
        navigator label that will be used to navigate the data table
      • onConfigure

        protected void onConfigure()
        Called on all components before any component is rendered. This method should be used to configure such things as visibility and enabled flags.

        Overrides must call super.onConfigure(), usually before any other code

        NOTE: Component hierarchy should not be modified inside this method, instead it should be done in Component.onBeforeRender()

        NOTE: Why this method is preferrable to directly overriding Component.isVisible() and Component.isEnabled()? Because those methods are called multiple times even for processing of a single request. If they contain expensive logic they can slow down the response time of the entire page. Further, overriding those methods directly on form components may lead to inconsistent or unexpected state depending on when those methods are called in the form processing workflow. It is a better practice to push changes to state rather than pull.

        NOTE: If component's visibility or another property depends on another component you may call other.configure() followed by other.isVisible() as mentioned in Component.configure() javadoc.

        NOTE: Why should Component.onBeforeRender() not be used for this? Because if a component's visibility is controlled inside Component.onBeforeRender(), once invisible the component will never become visible again.

        Overrides:
        onConfigure in class Component