Hello,
I want is such that the removeAction can only work if the paid amount =<0.
Now unfortunately my code below doesn’t work because as long as one of the schedule has been paid, the Datasource will aggregate the paid amounts and they will always be more than 0. How can I enforce it to limit to only the selected line?
@Inject private CollectionDatasource<PaymentSchedule, UUID> paymentScheduleDs; @Named("paymentScheduleTable.remove") private RemoveAction removeAction; @Override public void init(Map<String, Object> params) { removeAction.setBeforeActionPerformedHandler(new Action.BeforeActionPerformedHandler() { @Override public boolean beforeActionPerformed() { return paymentScheduleDs.getItems().iterator().next().getPaidAmount() <= 0; // || paymentScheduleDs.getItems().iterator().next().getPaidAmount() == 0; } }); super.init(params); }
Thanks in advance.
Regards,
Kenince