How to create multiple data in a screen?


I want to create multiple rows of records from a screen.

Example: user key in a range from 1 to 100. After user click ok button, system will generate 1 to 100 records into database.

My problem is, can i use AbstractEditor for this operation and override the commitAndClose function to write the data? But somehow i am stuck to refresh the table.

public void commitAndClose() {
    if (locationService.createLocation(locationDs.getItem())) {

Can someone help to give me some idea?

Thanks in advance.


Could you clarify whether you want these generated entities to be associated with the editing one, or are you trying to facilitate entities creation by using the editor screen?



I would like to facilitate entities creation by using the editor screen.



If the generated entities have nothing to do with the entity corresponded to the editor, then I see no reason to override and alter commitAndClose(). I suggest the following code:

private DataManager dataManager;
private Metadata metadata;

public void generate() {
    int count = 10;

    // DTO that contains information about currently committed entities.
    CommitContext commitContext = new CommitContext();
    for (int i = 0; i < count; i++) {
        // Create a new instance and set the attribute values
        Customer customer = metadata.create(Customer.class);
        customer.setName("Name" + 1);
        // Every created instance is added to the commit context
    // Finally, commit all newly created entities

You can use this code snippet in the place you prefer, for instance in a browser screen, service method etc., so there is no need to alter the default behavior of committing an editing entity.

1 Like


Thank you for your advise.

I trying the solutions, but hit other issue. will update here again.