Hi,
I have to create screen like below screen shot but i don’t find any resource to create it.
My requirement is once user fill the detail and click to ADD button then items will be add in to below table and after add all the items in table one by one then save it on click to save button.
So how to it means how to connect add button event with table and all the things ?
The AddBtn will create an entity using the metadata and then add it to the productList. To display a new element in the Table (update data), you need to call the Data Loader method - productsDl.load()
The ClearBtn will clear the productList and update the data in the Table
@Subscribe("clearBtn")
public void onClearBtnClick(Button.ClickEvent event) {
productList.clear();
productsDl.load();
}
The SaveBtn will save the productsList in the database. Method dataManager.commit returns the set of fresh entity instances just updated in database. Further work should be performed with these returned instances to prevent data loss or optimistic locking.
@Subscribe("saveBtn")
public void onSaveBtnClick(Button.ClickEvent event) {
CommitContext commitContext = new CommitContext(productList);
Set<Entity> committedEntities = dataManager.commit(commitContext);
productList = new ArrayList(committedEntities);
}
I’ve created a test project on 7.1 platform version - add-table-row.zip (85.1 KB)