getConfigLabelsByPosition [message #1715399] |
Mon, 23 November 2015 05:15  |
Eclipse User |
|
|
|
Hello,
I have a NatTable implementation where-in I am applying custom label for specific columns and cells. If custom label is for complete column, then I use ColumnOverrideLabelAccumulator. If it is for certain cells of data layer, I override getConfigLabelsByPosition()
Basically, in my table I have header rows and data rows. For data rows, I need to have different styling for specific columns, hence I have defined labels for same and config registry for such labels.
Problem is, getConfigLabelsByPosition() is not getting called for all the columns. After getting LabelStack for certain column number "n", it throws an exception:
java.lang.RuntimeException: java.lang.NullPointerException
at org.eclipse.nebula.widgets.nattable.data.ReflectiveColumnPropertyAccessor.getDataValue(ReflectiveColumnPropertyAccessor.java:58)
at org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsDataProvider.getDataValue(GlazedListsDataProvider.java:92)
at org.eclipse.nebula.widgets.nattable.layer.DataLayer.getDataValue(DataLayer.java:132)
at org.eclipse.nebula.widgets.nattable.layer.DataLayer.getDataValueByPosition(DataLayer.java:381)
What could be the reason that getConfigLabelsByPosition() is not getting called for specific column index. That too it gets called for header row, but never gets called for data row. I believe this overridden method shoul dbe called every time user changes position, and it should be called for all the column & row positions
Thanks
|
|
|
|
|
|
|
|
|
Re: getConfigLabelsByPosition [message #1715662 is a reply to message #1715659] |
Wed, 25 November 2015 02:13  |
Eclipse User |
|
|
|
Solved the issue. There was no issue with accumulator or getConfigLabelsByPosition(). Problem was that I was using ReflectiveColumnPropertyAccessor which calls getDataValue() and expects a getter method for given Column name. Though I was setting column property names and column property to label map but did not know that a getter would be required with get<ColumnName>
|
|
|
Powered by
FUDForum. Page generated in 0.05590 seconds