How to create two-way bindings for a conditional element? #7000
Answered
by
ogoffart
ultimaweapon
asked this question in
Q&A
-
I tried something like: enum SetupPage {
Intro,
DataRoot,
}
export component SetupWizard inherits Window {
in-out property <string> data-root <=> dr.path;
private property <SetupPage> page: SetupPage.Intro;
VerticalLayout {
if page == SetupPage.Intro: Intro {
vertical-stretch: 1;
}
if page == SetupPage.DataRoot: dr := DataRoot {
vertical-stretch: 1;
}
}
} But it does not works. It is error with |
Beta Was this translation helpful? Give feedback.
Answered by
ogoffart
Dec 5, 2024
Replies: 1 comment 1 reply
-
The trick is to go the other way around: export component SetupWizard inherits Window {
in-out property <string> data-root;
private property <SetupPage> page: SetupPage.Intro;
VerticalLayout {
if page == SetupPage.Intro: Intro {
vertical-stretch: 1;
}
if page == SetupPage.DataRoot: dr := DataRoot {
vertical-stretch: 1;
path <=> root.data-root;
}
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ultimaweapon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The trick is to go the other way around: