I'm working on a ui where tabs are added to a TabP...
# tornadofx
e
I'm working on a ui where tabs are added to a TabPane, and each Tab needs some initialization code like downloading data before the tab is activated. However, I don't want this data to be fetched for all tabs just because they were added to the TabPane, so
onDock
is no good. That got me thinking - is it correct to call
onDock
for a tab that's added to a TabPane, or should it just be called whenever the tab is activated? It might be better to just add another signal for when the component is "activated" or something like that. Any thoughts?
n
@edvin Maybe
onShow
,
onVisible
or
onActive
e
I think all of those is something you'd expect to always be called when a View is shown, that's why I'm wary of such a generic name. Thinking about it 🙂
c
onTabSelected? Doesn't the tab pane have a property one could listen to for this?
e
@Carlton Whitehead The issue is not how to get at the event but rather what to call it. I was thinking about
onTabSelected
until I was reminded of Accordion... hehe 🙂
I might just go with it anyways, I like
onTabSelected