Hi,
I am using jmix 2.3.1 and new fragment feature, but I cannot use them inside lazy loaded tabs.
First of all I never get ReadyEvent in fragment. I was able to get only Attach / Detach events.
// doesnt work
ComponentUtil.addListener(this, ReadyEvent::class.java) {
initFragment()
}
// this event works
ComponentUtil.addListener(this, AttachEvent::class.java) {
initFragment()
}
Then I think that there is egg-chicken problem to get components and work with them in fragment controller, because Autowiring components doesnt work in lazy loaded tabs and I need to get everything programatically by id. So I need to get special hidden component fragment id that I dont have and I dont have instance of component to get this ID. Do I understand this correctly?
// doesnt work, always uninitialized
@ViewComponent
private lateinit var someBtn: JmixButton
// what component to pass ?
FragmentUtils.getComponentId()
// where to get id ?
UiComponentUtils.getComponent(view, id)
Thank you,
Jakub