gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.53k stars 377 forks source link

DatepickerCell - Editing mode of CellTable is not resetted after the popup closes (no more selection possible etc) #6498

Closed dankurka closed 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 6499

Found in GWT Release (e.g. 1.5.3, 1.6 RC):
2.3

Encountered on OS / Browser (e.g. WinXP, IE6-7, FF3):
Windows 7 / Chrome
(Should be Browser-Independent)

Detailed description (please be as specific as possible):
When using the DatePickerCell, the CellTable "cellIsEditing"-Flag is not reset. This
results in some strange behavior, like that no more selection is possible after the
first date was selected by the datepicker.

The reason for this seems to be that DatePickerCell only consumes click and keydown
events and does not inform the CellTable properly about the chnges.

Shortest code snippet which demonstrates issue (please indicate where
actual result differs from expected result):

CellTable<X> ct = new CellTable();
ct.addColumn(new Column<X,Date>(new DatePickerCell()));
// do stuff, add columns etc

Workaround if you have one:
I am not sure how to handle this issue. Perhaps it would help to change something in
the ValueUpdater, or to overwrite the getConsumedEvents function?

Links to relevant GWT Developer Forum posts:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/1cca35383a3a09c0/d93ccfd04952c62d?lnk=gst&q=Datepickercell#d93ccfd04952c62d).

Reported by Eric6iese on 2011-06-20 16:10:35

dankurka commented 9 years ago
Workaround:
I could solve a lot of the issues above by overriding getConsumedEvents of "DatePickerCell"
as follows:
Set<String> s = new LinkedHashSet<String>();
s.addAll(super.getConsumedEvents());
s.add("focus")
return Collections.unmodifiableSet(s);

Seems like the "focus" event is missing in the DatePickerCell, which is a bit strange
given that it explicitly fires a focus event after it closes. Without this event, the
CellTable will never its isCellEditing state again, since the DatePickerCell won't
consume the focus event.

FURTHER NOTE:
This bugs should affect only tables which contain one or more readonly-columns!
It won't have an effect if all columns are writeable, as writeable columns affect the
edit state automatically. Maybe thats the reason why it wasn't reported before.

Reported by webmaster@hwsc.net on 2011-06-20 16:31:48

dankurka commented 9 years ago
Still exists in 2.5.0. The workaround helps a bit but there are other issues of selection
blocking:
1) when user cancels the date selection by clicking anywhere outside of picker;
2) when user changes the date in not selected row it gets selected but even after choosing
the date the selection is locked.

And yes, I have readonly columns in my CellTable.

Reported by radioanonzoi on 2012-12-11 09:27:01

dankurka commented 9 years ago

Reported by dankurka@google.com on 2013-05-28 00:54:33