I have made a new custom column for Tables which displays the value and the currency in one single field. This works fine. Then I tried to make the column editable. The AbstractMoneyField is a sequence box which contains a BigDecimal Field and a Currency Smart Field to select the currency. When I start editing the field, only one Text Field is displayed instead of the sequence box. Does anybody has any idea?
This is a small code sample of what I have already:
public class AbstractMoneyColumn extends AbstractColumn<IMoney> {
@Override
protected IFormField prepareEditInternal(ITableRow row) throws ProcessingException {
AbstractMoneyField f = new AbstractMoneyField () {};
mapEditorFieldProperties(f);
return f;
}
@Override
protected void execDecorateCell(Cell cell, ITableRow row) throws ProcessingException {
DecimalFormat fmt = new DecimalFormat("0.00");
fmt.setGroupingSize(3);
fmt.setGroupingUsed(true);
fmt.setParseBigDecimal(true);
cell.setText(fmt.format(getValue(row).getAmount()) + " " + getValue(row).getCurrency());
super.execDecorateCell(cell, row);
}
@Override
protected final int getConfiguredHorizontalAlignment() {
return 1;
}
}
See also: Amount and currency field.
Edit: URL
[Updated on: Thu, 20 November 2014 11:38] by Moderator
Report message to a moderator