1

I am new to GWT Development. In Celltable when i have selected on record, it will display a pop-up window. and then i will select OK/CANCEL button. it will close the pop-up window. if i select the same record what i have selected before it is not showing the pop-up window.
Please any one can help me.

Hilbrand Bouwkamp
  • 13,509
  • 1
  • 45
  • 52
user869143
  • 11
  • 4
  • 1
    I have the same situation see[here][1] [1]: http://stackoverflow.com/questions/8358325/how-to-deselect-a-row-in-gwt-celltable-without-firing-onselectionchange – enfany Dec 02 '11 at 15:16

2 Answers2

1

(from the answer to Kun Xia’s linked question)

you might make use of CellPreviewEvent or override the SimpleSelectionModel – have a look at this thread for details.

Community
  • 1
  • 1
törzsmókus
  • 1,799
  • 2
  • 21
  • 28
1

I assume your are doing something like this:

selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
  public void onSelectionChange(SelectionChangeEvent event) {
    //show popup here
  }
});

If that is what you are doing, then the behavior your are seeing is expected. SelectionChangeEvent will fire only when selection is changed. When you click on an already selected row, the selection remains same, hence no event is fired.

You should handle ClickEvent instead of SelectionChangeEvent. Frankly, I don't know if it is possible to handle click event for the whole row in a CellTable. If you don't really need the CellTable functions, you can simply use an HTMLTable subclass (FlexTable or Grid) which has simple method for handling click events.

Tahir Akhtar
  • 11,385
  • 7
  • 42
  • 69