GroupBox - how to force it to always start collapsed?

I have a GroupBox on a screen, and both collapsable and collapsed are set to true. On my initial test of the screen, the GB started out collapsed, just as I expected. On further runs, it is starting expanded unless I close the screen with it collapsed.

There seems to be no setCollapsed() method or any other way I could force it to be collapsed.

Is there another way to accomplish this?

Seems there’s a terminology mismatch - in Studio, in the designer, you set Collapsable and Collapsed, but if you want to control the “collapsed” state programmatically, you have to call setExpanded(...).

1 Like

Hi @jon.craig,

Studio reflects XML attributes, so there is a terminology mismatch in XML and Java API.

The reason is that GroupBox collapsed state is stored in user settings. For simplicity, you can disable user settings for a certain GroupBox by defining the settingsEnabled="false" attribute.


1 Like