You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2017/06/22 20:04:00 UTC

[jira] [Commented] (WICKET-6407) AjaxChannel new Type LAST or CheckGroupSelector update

    [ https://issues.apache.org/jira/browse/WICKET-6407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16059917#comment-16059917 ] 

Martin Grigorov commented on WICKET-6407:
-----------------------------------------

Having a table with hundreds of rows and using Wicket behavior for each of them is not a good idea! Binding JS event listeners for so many HTML elements will slow down your browser.

I'd suggest you to rework it to use a custom Checkbox for the group selector. This checkbox will have Ajax behavior that will change the state of the row checkboxes without clicking them and send an Ajax request with a single value - its state (checked vs. unchecked). Then use the value at the server side to update the server state of the row checkboxes.

This requires some custom coding but your users will be much happier!

> AjaxChannel new Type LAST or CheckGroupSelector update
> ------------------------------------------------------
>
>                 Key: WICKET-6407
>                 URL: https://issues.apache.org/jira/browse/WICKET-6407
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 7.7.0
>            Reporter: Stephan Weck
>            Priority: Minor
>
> In our current project we use a Datatable to show user data. In certain cases this table could contain more than 50.000 entries. The handling with the wicket ajax components is quite good and works ok.
> In my DataTable i have a CheckBox Panel and a CheckGroupSelector in the Header of the table. All the elements are added to a CheckGroup.
> To identify which elements are selected in the Group i added an AjaxFormChoiceComponentUpdatingBehavior to the Group.
> This works perfect if i select single elements in the tabel.
> Now my problem:
> If i have 100+ Elements in my table and i press the CheckGroupSelector for each CheckBox element the onUpdate method of the AjaxFormChoiceComponentUpdatingBehavior is triggered. For 100 elements the duration is about 3-5 seconds but if i have 1000 elements the ajax request are not ending in a realistic time.
> My idea is to add a new AjaxChannel which only handles the last request, or as an probably better alternative the Ajax Behavior of the CheckGroupSelector schould be changed.
> Clicking on this Checkbox should trigger only an Ajax Call, Select all checkboxes in the group and update the Model with all selected elements.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)