@@ -436,8 +436,8 @@ with example(ui.keyboard):
with example(ui.open):
with ui.page('/yet_another_page') as other:
ui.label('Welcome to yet another page')
- ui.button('BUTTON', on_click=lambda e: ui.open('/', e.socket))
+ ui.button('RETURN', on_click=lambda e: ui.open('/', e.socket))
- ui.button('BUTTON', on_click=lambda e: ui.open('/yet_another_page', e.socket))
+ ui.button('REDIRECT', on_click=lambda e: ui.open('/yet_another_page', e.socket))
ui.run(port=8080)
@@ -9,6 +9,9 @@ class Open:
Open
Can be used to programmatically trigger redirects for a specific client.
+
+ :param path: string that is a relative url path or an absolute url
+ :param socket: WebSocket defining the target client
"""
asyncio.get_event_loop().create_task(self.redirect_async(path, socket))
@@ -5,6 +5,7 @@ from pydantic import BaseModel
import traceback
from typing import Any, Awaitable, Callable, List, Optional, Union
from starlette.websockets import WebSocket
from .elements.element import Element
from .task_logger import create_task