screenBuilders size screen

Hi all,
I need to open a browse entity screen from an edit form.
This browse sceen is the same that I use in full screen for manage entity.

To do this I normally use sceenbuilder istruction.
Example :
screenBuilders.lookup(Art.class, this)
.withLaunchMode(OpenMode.DIALOG)
.build()
.show();

When Cuba open dialogue I have a little form than I can’t resize.
How can I set with and height of dialogue screen?
Thank for response
Best regards
Giuseppe

I’d recommend setting dialog size once on the screen side instead of setting it again for each opening. There is dialogMode for that in window.xsd:

<dialogMode height="600"
            width="800"
            positionX="200"
            positionY="200"
            forceDialog="true"
            closeOnClickOutside="false"
            resizable="true"/>

Or you can set it with annotation on screen class:

@DialogMode(height = "200px", width = "300px")

See also Screen XML Descriptors - CUBA Platform. Developer’s Manual

Hi Yuriy,
Thank you for help.
I have used @DialogMode istruction in screen class, but It doesn’t change nothing.
I have put a breakpoint in webscreen class createWindow function. If I evaluate width and height variables, they are the same that I put in @DialogMode row, but the window is every the same showned independent of this values.
I don’t understand what I wrong

Hi.
As it described in documentation settings in XML have priority over the annotation for all parameters except forceDialog . The forceDialog parameter is joined: when it is set to true either in the annotation or in XML, the screen is always opened in a dialog.
So, if you want to set dialog size using annotation, delete height and width settings from XML teg <dialogMode/>.

Regards,
Natalia

1 Like