jeudi 21 décembre 2017

How can i check all the checkboxes, even the ones hidden by pagination?

I have an array of informations that will be shown in a table justr like the image:

exemple 1

As you can see, there is this checkbox that checks all the other ones. The first pagination only shows the 10 firsts results of 26. To check the checkboxes i am calling OnCreate of each checkbox and adding it in a list so a can check everyone, but the OnCreate of each checkbox is only called when i go through the pages; if i dont, only the 10 firsts are added in array.

I cannot send it checked when sending the informations because the checkboxes are not created yet.

Does anyone knows how can i add every checkbox of each line in that array?

obs: I am using zk 7.0.0

Some code:

<column label="2ª Via" align="center" >
    <checkbox id="chkbxPai" onCheck="eac808$composer.habilitaTodosCheckBox(self.checked)"/>

<cell align="center">
    <checkbox id="chkbox2Via" onCreate="eac808$composer.adicionaNaListDeCheckBox(self)" />  

public void adicionaNaListDeCheckBox(Checkbox checkbox) {
    if (!this.listaDeCheckbox.contains(checkbox)) {
       this.listaDeCheckbox.add(checkbox);
   }
}




Aucun commentaire:

Enregistrer un commentaire