How to use tabsheet lazy loading with fragments?

Dear team,
I want to use lazy loading mode in the tabsheet, but this way I cannot inject the fragment into the controller. I need to pass parameters to the fragment before the fragment is displayed, and display different content according to different parameters.

Thanks for your time

I’ve tried to use UiComponentUtils.getComponent() to get the fragment, but the components inside the fragment still can’t be loaded automatically, do I need to load all the components manually?

Hi,

As said in documentation, you can’t inject component inside lazy tabs due to component still not created. You trying to fight with feature that meaning to be not initialized before been clicked. tabSheet :: Jmix Documentation

There is fragmentCreator to initialize fragment from code, you can set only divs inside tabs and only when tab is selected you can initialize the fragment.

So, yes only manually creation is solution

Reagards,
Dmitry

1 Like

Thank you,i will try it.