You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use "Refreshable UI with parameters" it throws next error:
refreshable.refresh() takes 1 positional argument but 2 were given
Traceback (most recent call last):
File "/home/alex/Workspace/python/menu/.venv/lib/python3.10/site-packages/nicegui/events.py", line 283, in handle_event
result = handler() if no_arguments else handler(arguments)
File "/home/alex/Workspace/python/nicegui-menu/test.py", line 13, in <lambda>
ui.button('Refresh for Tokyo', on_click=lambda: clock_ui.refresh('Asia/Tokyo'))
TypeError: refreshable.refresh() takes 1 positional argument but 2 were given
I use an example from the documentation:
importpytzfromdatetimeimportdatetimefromniceguiimportui@ui.refreshabledefclock_ui(timezone: str):
ui.label(f'Current time in {timezone}:')
ui.label(datetime.now(tz=pytz.timezone(timezone)).strftime('%H:%M:%S'))
clock_ui('Europe/Berlin')
ui.button('Refresh', on_click=clock_ui.refresh)
ui.button('Refresh for New York', on_click=lambda: clock_ui.refresh('America/New_York'))
ui.button('Refresh for Tokyo', on_click=lambda: clock_ui.refresh('Asia/Tokyo'))
ui.run()
nicegui version 1.2.21
For version 1.3.7 I don't see the error but it doesn't refresh the UI
I've tested it on:
os: Linux Ubuntu - 22.04.2 LTS
python: - 3.10.6
browser: Firefox - 115.0.2 (64-bit)
The text was updated successfully, but these errors were encountered:
Thanks for reporting this issue, @alex-bezverkhniy!
We introduced parameters for the refresh only recently, so I wouldn't expect it to work with version 1.2.21. But of course it should refresh the label with the most recent version 1.3.7, which it doesn't. It could be related with #1313.
Description
When I use "Refreshable UI with parameters" it throws next error:
I use an example from the documentation:
nicegui version
1.2.21
For version
1.3.7
I don't see the error but it doesn't refresh the UII've tested it on:
22.04.2 LTS
3.10.6
115.0.2 (64-bit)
The text was updated successfully, but these errors were encountered: