|
Re: NatTable : Table level validations [message #1278808 is a reply to message #1278693] |
Thu, 27 March 2014 22:01 |
John Steele Messages: 50 Registered: January 2010 |
Member |
|
|
Hi Pavan,
You need to attach a label to the cells that have validation errors, and then register a Style (perhaps with a background color or red/pink) under that same label.
Here's how you register the style:
public static final String CELL_ERROR = "invalid";
configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_STYLE,
style,
DisplayMode.NORMAL,
CELL_ERROR);
You might also want to have a label accumulator, which will add the CELL_ERROR label to the cells that have an error.
Here's how you might do that:
natTableBodyDataLayer.setConfigLabelAccumulator(new IConfigLabelAccumulator() {
@Override
public void accumulateConfigLabels(LabelStack configLabels,
int columnPosition, int rowPosition) {
if (errorExistsOnCell (columnPosition, rowPosition)) {
configLabels.addLabelOnTop(CELL_ERROR);
}
}
}
});
Cheers!
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03646 seconds