JmixButton cannot getId() if button belongs to a Fragment

Hi Jmix Support team,

For JmixButton, we usually use jmixButton.getId().get() in order to obtain the ID attribute of the button.
However, if this button belongs to a Fragment, this method will return me “null” even though the ID is already defined in the descriptor.
Other attributes of the button can be returned without an issue, eg. text/themeNames/classNames etc. so could you please help and check if this is a bug?

Hi,

id defined in XML for inner fragment components is set as virtual, i.e. it isn’t reflected into components id property. This is because you can have several fragments of the same type on the view, but components id must be unique within the view scope. To obtain fragment inner component id, use the io.jmix.flowui.fragment.FragmentUtils#getComponentId method.

Regards,
Gleb