-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement TabSheet lazy tabs 3029 #3094
Conversation
jmix-flowui/flowui/src/main/java/io/jmix/flowui/component/tabsheet/JmixTabSheet.java
Outdated
Show resolved
Hide resolved
jmix-flowui/flowui/src/main/java/io/jmix/flowui/component/tabsheet/JmixTabSheet.java
Outdated
Show resolved
Hide resolved
jmix-flowui/flowui/src/main/java/io/jmix/flowui/xml/layout/loader/container/TabSheetLoader.java
Outdated
Show resolved
Hide resolved
jmix-flowui/flowui/src/main/java/io/jmix/flowui/xml/layout/loader/container/TabSheetLoader.java
Outdated
Show resolved
Hide resolved
jmix-flowui/flowui/src/main/java/io/jmix/flowui/component/tabsheet/JmixTabSheetUtils.java
Outdated
Show resolved
Hide resolved
jmix-flowui/flowui/src/main/java/io/jmix/flowui/xml/layout/loader/container/TabSheetLoader.java
Outdated
Show resolved
Hide resolved
jmix-flowui/flowui/src/main/java/io/jmix/flowui/facet/impl/SettingsFacetHelper.java
Outdated
Show resolved
Hide resolved
jmix-flowui/flowui/src/main/java/io/jmix/flowui/xml/layout/loader/container/TabSheetLoader.java
Outdated
Show resolved
Hide resolved
@@ -124,6 +164,23 @@ public Component getContent() { | |||
} | |||
} | |||
|
|||
public static class LazyTabLoader extends TabLoader { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need it if we don't create it
ComponentLoader<?> componentLoader = loader.getLoader(subElement, TabLoader.class); | ||
componentLoader.initComponent(); | ||
boolean shouldBeLazy = loadBoolean(subElement, "lazy").orElse(false) && !firstTab; | ||
ComponentLoader<?> componentLoader = loader.getLoader(subElement, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we already know if a tab is lazy, so we can skip creating Loader
and putting it in pendingLoadComponents
. If a tab is lazy
, it'd be more efficient to store an element
rather than a loader
instance. A loader can be created in the selectedTabChangeHandler
on demand.
#3029