Skip to content

How to create two-way bindings for a conditional element? #7000

Answered by ogoffart
ultimaweapon asked this question in Q&A
Discussion options

You must be logged in to vote

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;
        }
    }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ultimaweapon
Comment options

Answer selected by ultimaweapon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants