I am trying to create an editable page where the master record is shown at the top of the page, the detail records are then displayed in an editable table. The master and details can be edited and saved correctly. I have implemented an “Add Line” button that will add a new line in the detail table, the new record is displayed correctly but the values entered in the new record are not saved, the record is saved with not data.
public class OrderEdit extends StandardEditor<Order> {
@Inject
private CollectionPropertyContainer<OrderLine> orderLinesDc;
@Inject
private Metadata metadata;
@Inject
private InstanceContainer<Order> orderDc;
public void onCreateButtonClick() {
OrderLine orderLine = metadata.create(OrderLine.class);
orderLine.setOrder(orderDc.getItem());
orderLinesDc.getMutableItems().add(orderLine);
}
}
master-detail.zip (84.9 KB)