Wicket
  1. Wicket
  2. WICKET-4772

DataTable API and handling of AbstractToolbar

    Details

      Description

      The DataTable API is not optimal from my point of view as a user. What I do today is that I copy-paste most of the data table code in order to break the data table API open. To name a tangible example:

      I implemented a toolbar that applies an Ajax-table-refreshing-filter to each column's values. The updating of the data table's contents is fairly simple by overriding the data table's "newBodyContainer" method, extracting the component and adding it to the AjaxRequestTarget whenever the table is updated. However, this does not affect any of the other abstract toolbars since they are of course not part of the body container. (Adding the entire table to the AjaxRequestTarget what would include the toolbars is not an option, however. This would also refresh the Ajax-filtering-toolbar itself and the e.g. filtering text field would loose its focus.)

      It could now be as easy as overriding the "addTopToolbar" and "addBottomToolbar" methods of the DataTable class and adding all toolbars that one extracted from calls to those methods but the filtering toolbar itself. This is however not possible since these components are not anchored in HTML-tags but in Wicket-tags.

      My suggestion:
      -> Refactor DataTable to allow access to all children by default. (Toolbars and body container).
      -> Refactor AbstractToolbars integration to allow adding to an AjaxRequestTarget

      This would allow for a whole bunch of new AjaxComponents that do not even need to reload the entire table. Since DataTables often operate with data base access, I belive this would be useful to many users.

        Activity

        Hide
        Martin Grigorov added a comment -

        Getters for the main sub-parts are added with rev 76aef88.
        Please attach a patch with any further improvements you may see.

        Show
        Martin Grigorov added a comment - Getters for the main sub-parts are added with rev 76aef88. Please attach a patch with any further improvements you may see.
        Hide
        Martin Grigorov added a comment -

        Please attach a patch with your suggested changes.
        Thanks!

        Show
        Martin Grigorov added a comment - Please attach a patch with your suggested changes. Thanks!

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Rafael Winterhalter
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development