Alter An Opened Dialog Box

I have a button that I want to trigger the “list_add” action on a data grid. Presently it works correctly as follows:

    public void onStatusChangeButtonClick(final ClickEvent<JmixButton> event) {
        detailsTabSheet.setSelectedIndex(2);
        refRegulationDataGridRegulationAdd.execute();
    } 

Following the opening of this dialog box I would like to alter the dialog to modify the options presented to the user. Typically list_add events would show a <select> of a few types and I would like to alter the <collection> <query> to allow a few more options when the open it in this way (a regulatory issue that we’re trying to track without annoying our users too much).

In this instance, I do not understand how I can alter the contents of the dialog box besides just opening it. I understand there is an API for it, but I am not understanding how to approach this use case, or if it should be done as a separate view for the same data table even.

Any help is appreciated.

Thank you,
Oran

Hi Oran,

Perhaps you need to invoke the DialogWindows.lookup() method explicitly as described in Opening Dialog Windows and set some parameters in the called view.

Please provide a simple test project with few entities similar to your data model, corresponding views and actions. We’ll adjust your project to meet your requirements and provide an explanation.

Regards,
Konstantin

Thank you for the help. I was using DialogWindow.lookup() and kept getting weird results. Took awhile to notice it but I was able to get it with getting that right.

Thank you,
Oran