I have a custom component which is a CompositeComponent.
@CompositeDescriptor("master-data-combo-box.xml")
class MasterDataComboBox :
CompositeComponent<CssLayout>(),
Field<BaseMasterData>,
CompositeWithCaption,
CompositeWithHtmlCaption,
CompositeWithHtmlDescription,
CompositeWithIcon,
CompositeWithContextHelp,
Focusable, Logging {
init {
addCreateListener {
radioButtonBox = getInnerComponent("radioButtonBox")
radioButton = getInnerComponent("radioButton")
cleanButton = getInnerComponent("cleanButton")
newButton = getInnerComponent("newButton")
entityComboBox = getInnerComponent("entityComboBox")
availableEntitySelectors = listOf(radioButton, entityComboBox)
// Set entityComboBox as the default component. We need it during initialisation.
actualEntitySelector = entityComboBox
// clean button for radioButton
cleanButton.addClickListener { value = null }
newButton.addClickListener { createNewItem() }
}
addAttachListener {
if (isVisible) initialize()
else shouldBeInitialized = true
}
}
I would like to initialize() not during attach event but during onBeforeShow event.
How to do this ?