Launch dialogs.createInputDialog

Hi,

I have a Datagrid and a button.When I click the button I scroll the table and for each row I launch a Dialogs.createInputDialog() but this opens at the end of the cycle.
I would like the Dialogs to open every time I finish reading the line.

@Subscribe(“File”)
public void onFileClick(Button.ClickEvent event) {
table.getItems().getItems().forEach(e-> {

      //text.....

        if (nReg!=null) {
            dialogs.createInputDialog(this)
                    .withCaption(" ")
                    .withParameters(
                            InputParameter.parameter("Update").withField(() -> {

                                //class
                                RadioButtonGroup radioButton = uiComponents.create(RadioButtonGroup.NAME);

                                Map<String, String> mappaSetRadio = new LinkedHashMap<>();


                                mappaSetRadio.put("YES", "1");
                                mappaSetRadio.put("NO", "2");


                                radioButton.setOptionsMap(mappaSetRadio);
                                radioButton.setValue("2");
                                return radioButton;

                            })
                    )

                    .withActions(DialogActions.OK_CANCEL)
                    .withCloseListener(closeEvent -> {
                        if (closeEvent.getCloseAction().equals(InputDialog.INPUT_DIALOG_OK_ACTION)) {

                            String risult = closeEvent.getValue("Update");

                            try {
                                if (risult.equals("1")) {

                                   //

                                    }
                                } else if (risult.equals("2")) {

                                   //


                                }
                            } catch (Exception ex) {
                                //
                            
                            }


                        }
                    })
                    .show();


        }else {




        }



    });



}

What’s the problem?
Can you help me?
Thank’s

Hello,

it is because the thread opens the screen and continues the execution.

I would suggest collecting items and create a specific screen where the user can perform some actions instead of opening InputDialog for each item.