0

Recursive walk through a grid with paging?

asked 2017-10-26 16:28:03 +0800

Tegomena gravatar image Tegomena
33 4

Hello,

I have a grid with paging. The first column contains always a checkbox which is per default not checked. Now, I want to have a button "Select all" which activates all checkboxes in the grid.

I wrote a recursive function which goes through all child elements of the grid and actiavtes the checkboxes. Unfortunately, it seems so that the grids children are just created "on demand", as the user clicks through the pages. For example, if we have 4 pages with entries and the user watches just the first one, only the checkboxes on the first page get activated.

Any idea how we can solve that easily (ZK 7.0.3)?

And here is my recursive function:

public void checkAllCheckboxes(Component g) {

    if (g instanceof Checkbox) {
        ((Checkbox) g).setChecked(true);
    }
    List<Component> list = g.getChildren();
    for (Component child : list) {
        checkAllCheckboxes(child);
    }
}
delete flag offensive retag edit

Comments

hello Tegomena, to do this in a simple way, separates the data from the view with the mvvm technique, and you will have no problem with paging.

LuigiFabbri ( 2017-10-27 17:38:38 +0800 )edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2017-10-26 16:28:03 +0800

Seen: 2 times

Last updated: Oct 26 '17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More