* Append a Datebox "init date" to row
*
* @param row
*/
private void appendDateboxInitDate(final Row row) {
Datebox initDateBox = new Datebox();
bindDateboxInitDate(initDateBox, (ResourcesCostCategoryAssignment) row.getValue());
initDateBox.setConstraint("no empty:" + _("Start date cannot be empty"));
row.appendChild(initDateBox);
initDateBox.addEventListener("onChange", new EventListener() {
@Override
public void onEvent(Event event) {
// Updates the constraint of the endDate box with the new date
LocalDate initDate = ((ResourcesCostCategoryAssignment)row.getValue()).getInitDate();
Datebox endDateBox = (Datebox) row.getChildren().get(2);
endDateBox.setConstraint("after " +
String.format("%04d", initDate.getYear()) +
String.format("%02d", initDate.getMonthOfYear()) +
String.format("%02d", initDate.getDayOfMonth()));
}
});