jeudi 23 février 2017

GWT celltable combine two click in one

i have a celltable with checkbox i want to combine two click when i select the row i change also the state of checkbox i try this but it doesn't work

column.setFieldUpdater(new FieldUpdater() {

                @Override
                public void update(int rowIndex, final Item item, final CheckBoxDisablingCell.CheckState state) {
                    if(!state.isDisabled()) {                        
                        item.getFonctions().get(index).setSelected(state.isChecked());

                        Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                            @Override
                            public void execute() {
                                selectionModel.clear();
                                selectionModel.setSelected(gestionHabilitationsItem, true);                                    cellTableFonctions.setSelectionModel(selectionModel);                                    leftCellTable.setSelectionModel(selectionModel);
                            }
                        });
                    }
                }
            });

With this code i have two click one for select the row and another for change the state of the checkbox. How can i combine it? Appreciate any suggestions.




Aucun commentaire:

Enregistrer un commentaire