Skip to content
Discussion options

You must be logged in to vote

If you are not required to use yml to save your config you could do a combination of app.storage and binding:

@ui.page('/pageA')
def pageA():
    ui.switch(on_change=lambda e: app.storage.user.update({'switch': e.value}))


@ui.page('/pageB')
def pageB():
    def get_text(value: bool):
        return 'PageA switch is on' if value else 'PageA switch is off'

    ui.label(get_text(False)).bind_text_from(app.storage.user, 'switch', get_text)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Anindya088
Comment options

@Anindya088
Comment options

@rodja
Comment options

@Anindya088
Comment options

Answer selected by Anindya088
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