private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<CreditLine>> cellItem,
String componentId, IModel<CreditLine> rowModel) {
CreditLine line = rowModel.getObject();
User debtor = line.getDebtor();
cellItem.add(new Label(componentId, debtor != null ? debtor.getDisplayName() : "-"));
}
});
//Amount
columns.add(new AbstractColumn<CreditLine, String>(new ResourceModel(MKEY_MAX_AMOUNT)) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<CreditLine>> cellItem,
String componentId, IModel<CreditLine> rowModel) {
final CreditLine line = rowModel.getObject();
cellItem.add(new AttributeAppender("style", ";width:110px;"));//TODO: constant
cellItem.add(new AjaxEditorLink<BigDecimal>(componentId, new PropertyModel<BigDecimal>(line, "maxCreditValue")) {
private static final long serialVersionUID = 1L;
private NumberTextField<BigDecimal> amountInput;
@Override
protected boolean onValueSubmit(AjaxRequestTarget target) {
BigDecimal newValue = amountInput.getModelObject();
creditLineWriter.setCreditLine(line.getCreditor(), line.getDebtor(), newValue);
return true;
}
@Override
protected Component getFormControl(String controlId, final IModel<BigDecimal> model) {