Skip to content

Dynamic content generation - dialog issue #3639

Closed Answered by python-and-fiction
marinkreso95 asked this question in Q&A
Discussion options

You must be logged in to vote

Please check this https://github.com/zauberzeug/nicegui/wiki/FAQs#why-is-the-last-element-of-my-for-loop-used-in-every-step.

from nicegui import ui,events,app
class NumberOfElements:
    def __init__(self):
        self.number = 1
        self.sel_matches = []

noe = NumberOfElements()
report_toggle = ui.toggle({1: '1', 2: '2', 3: '3'}, value=1, on_change=lambda e: button_view.refresh(e.value)).classes('mx-auto')#.bind_value(noe, 'number')


@ui.refreshable
def report_view(matches):
    print('INSIDE REPORT VIEW', matches)
    for m in matches:
        ui.label(m).classes('mx-auto')

def dialog_action(this_dialog, i):
    print('INSIDE DIALOG ACTION', i, this_dialog)
    noe.sel_matches[i] =

Replies: 1 comment 1 reply

Comment options

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

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