Open crisalder2806 opened 2 years ago
Thanks for the suggestion. Can you give an example use case where you need it? Then it is easier to create a good solution which also covers your case
HI, e.g. you add a specific app tab into sw-product-detail which is loading information from an external source or does some other things. Now you only want to start loading the content of the tab if its active to reduce load on the server and also make the ui faster.
another example. i try to load per app a custom entity table which lists all transaction information for an order and presents details, i currently do not now what order i'm actively looking at and need to use sessionstorage to save the entity.id per data subscribe on sw-order-detail-base__order. unfortunately this event is only triggered on a page refresh when im on the general tab, not if i refresh on my custom tab, requires to currently switch between tabs to get this information.
cheers, Horst
Please correct me if I'm wrong but this sounds like the SDK should be capable of this already.
Let me elaborate on what I expect to happen with tabs.
You add a tab via:
ui.tabs('sw-product-detail').addTabItem({
label: 'Example tab',
componentSectionId: 'example-product-detail-tab-content'
})
Module loads and the General Tab is displayed 2.1 Your app iframe is not displayed and therefore should not load any data
The user clicks your tab you load your data
The second part you mentioned @horfic sounds like a different problem for me. The issue is not that you don't know which tab you are on but more that the relation between tab and parent module information is missing.
Please correct me on any of these points, if I misunderstood something 😊
sw-tabs
is not emitting anything out currently, so we don't know which is the active item. Could you help to add it?