Problem using DateCellEditor [message #1701736] |
Wed, 15 July 2015 09:52 |
Roma Lahoti Messages: 6 Registered: March 2015 |
Junior Member |
|
|
Hi,
I am trying to show a date editor in one of the columns in my NAT UI.
I have included the following in my code :
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR,
new DateCellEditor(),DisplayMode.EDIT, DATE_LABEL);
On clicking that particular cell, i get a calendar instance to choose a date from.
I can easily choose different dates from it. But the moment i shift to any other cell, the date cell value becomes empty.
i have a check in setDataValue() :
if (userValue == null)
super.setDataValue(columnIndex, rowIndex, "");
else
super.setDataValue(columnIndex, rowIndex, userValue.toString());
I am not sure why the userValue is null always in this case.
Am i missing anything here?
Attached are 2 screenshots for the same.
How can i set this selected date in the date column?
|
|
|
|
Re: Problem using DateCellEditor [message #1701832 is a reply to message #1701745] |
Thu, 16 July 2015 06:06 |
Roma Lahoti Messages: 6 Registered: March 2015 |
Junior Member |
|
|
Hello Dirk,
I am already using a DefaultDateDisplayConverter.
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER,
new DefaultDateDisplayConverter(),DisplayMode.NORMAL,
DATE_LABEL);
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER,
new DefaultDateDisplayConverter(),DisplayMode.EDIT,
DATE_LABEL);
But it displays message : Cannot format given Object as a Date at org.eclipse.nebula.widgets.nattable.data.convert.DefaultDateDisplayConverter canonicalToDisplayValue.
if i double click a particular cell to edit and enter nothing , the pointer gets stuck in that cell when i try to shift to another cell. For this I am overriding the setDataValue to check for blank data
if (userEnteredValue == null)
super.setDataValue(columnIndex, rowIndex, "");
else
super.setDataValue(columnIndex, rowIndex, userEnteredValue.toString());
I am not sure what is missing.
On digging more into the code, i see that null value is passed as date to DateCellEditor , I don't know why. As on the UI , I am able to see the selected date.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09662 seconds