I have a celltable in GWT which have checkboxes, to select multiple checkboxes i am using selectionModel,once I check any checkbox its values get saved in the selectionModel,but then when i uncheck the checkbox , they never get remove , i want to remove the previous selection , how can it be possible
below is the code
List<Categories> selected;
display.getListWidget().getSelectionModel().addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
selected = new ArrayList<Categories>(
((MultiSelectionModel<Categories>) display.getListWidget().getSelectionModel()).getSelectedSet());
}
});
What i am trying to do is
display.getListWidget().getSelectionModel().setSelected(categories, false);
but its not working , coz i guess categories is not the one which is already added ..
Any Suggestions
Thanks
If you could clarify your question with some more code or by being more specific, we might be able to give a better answer. From your question, I’m guessing that your Categories equals and hashcode are not overwritten in a way that the “categories” you are trying to set is being found.
I’m guessing a bit here but I think a KeyProvider will help you deselect the correct Categories object.
view:
presenter: