Skip to content

When We updating the values attribute of a wave table, rows selection in the UI are not updating accordingly #2445

Open
@sulhicader

Description

@sulhicader

Wave SDK Version, OS

Wave version - (1.6.0, MacOS and App Store )
(e.g. 4.2.0, Windows)

Actual behavior

When updating( set an empty list or set a list with different set of rows) the Values attribute of a wave table rows selection in the UI are not updating accordingly.

Expected behavior

from h2o_wave import main, app, Q, ui

@app('/demo')
async def serve(q: Q):
    if q.args.show_inputs:
        table = q.page["example"].items[0].table
        table.rows= [
                        ui.table_row(name='row1', cells=['Row 1']),
                        ui.table_row(name='row2', cells=['Row 2']),
                        ui.table_row(name='row4', cells=['Row 4']),
                        ui.table_row(name='row5', cells=['Row 5'])
                    ]
        table.multiple = True
        table.values = ['row1','row5']
    else:
        q.page['example'] = ui.form_card(box='1 1 -1 5', items=[
                ui.table(
                    name='table',
                    columns=[ui.table_column(name='text', label='Table multiple selection', min_width='300px')],
                    rows=[
                        ui.table_row(name='row1', cells=['Row 1']),
                        ui.table_row(name='row2', cells=['Row 2']),
                        ui.table_row(name='row3', cells=['Row 3']),
                        ui.table_row(name='row4', cells=['Row 4']),
                        ui.table_row(name='row5', cells=['Row 5'])
                    ],
                    multiple = True,
                    values=['row2','row4'],
                ),
                ui.button(name='show_inputs', label='Submit', primary=True)
            ])
    await q.page.save()
Screen.Recording.2025-02-07.at.16.42.41.mov

I expect when click on the submit button, Selected rows in the UI changed to row1 and row5. But actually row selection in UI doesn't change.

Steps To Reproduce

  1. Do this
  2. Do that
  3. Do something else
  4. See error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug in codeuiRelated to UI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions