The initialLayout component is a layout that will be displayed when no views are opened in the main view. This component can be useful when you need to show some default content, such as a logo or dashboard, before any other views are opened.

  • XML element: initialLayout


initialLayout is a nested element of the appLayout component.

To add a nested initialLayout element in Jmix Studio, select the appLayout element in the main view descriptor XML or in the Jmix UI structure panel and click on the Add→InitialLayout button in the Jmix UI inspector panel.

An example of defining initialLayout in main-view.xml:

<mainView xmlns=""
        <navigationBar .../>
        <drawerLayout .../>
            <image id="urlImage"

When added in XML, the root <initialLayout> element effectively is VerticalLayout.

Alternatively, the StandardMainView Java API can be used to set/get the initial layout:

  • getInitialLayout() - returns the root component of the initial layout.

  • setInitialLayout() - sets a component that will be the initial layout.

Components inside initialLayout can be injected into the MainView, for example:

private JmixImage<Object> urlImage;

public void onInit(final InitEvent event) {

@Subscribe(id = "urlImage", subject = "singleClickListener")
public void onUrlImageClick(final ClickEvent<JmixImage<?>> event) {"Clicked!");


To generate a handler stub in Jmix Studio, use the Handlers tab of the Jmix UI inspector panel or the Generate Handler action available in the top panel of the view class and through the CodeGenerate menu (Alt+Insert / Cmd+N).