How to show image/fragment in initial layout in tabbed window mode

I am not able to show image and fragments in initallayout in tabbed window mode.

please advice. Thanks

Hello!

Thank you for reporting the problem! There is a similar issue: Tabbed Application Mode / Details Element -> Size Attribute · Issue #4230 · jmix-framework/jmix · GitHub

You can try to programmatically add components to the initial layout:

<workArea id="workArea"
          classNames="jmix-work-area">
    <initialLayout id="initialLayout" width="100%" height="100%"/>
</workArea>
@ViewComponent
private VerticalLayout initialLayout;

@Subscribe
public void onInit(final InitEvent event) {
    initialLayout.add(new Span("Programmatic span"));
}
1 Like

Thanks @pinyazhin , It is working

My fragment has datagrid, how can i make it to show in initiallayout in main view to cover full area (100%, 100%). Initialyout.expand not having any effect. All other vbox are 100%, 100%

Screenshot 2025-03-07 191414

Thanks

Could you share an XML file of your fragment and main-view.xml?

Attached please
mainfrag.zip (3.5 KB)

@Subscribe
public void onInit(final InitEvent event) {
    RecentUpdateFragment recentUpdateFragment = fragments.create(this, RecentUpdateFragment.class);
    in1.add(recentUpdateFragment);
    in1.expand(recentUpdateFragment);

}

Above is code to show the fragment in mainView.

Probably, the height attribute in initialLayout is also not loaded. Try to set height to the initialLayout programmatically:

@Subscribe
public void onInit(final InitEvent event) {
    in1.setHeightFull();
    // ...
}