h2oai / nitro

Create apps 10x quicker, without Javascript/HTML/CSS.
https://nitro.h2o.ai
Apache License 2.0
201 stars 13 forks source link

Existing web views cannot be replaced with new URLs #66

Open lo5 opened 2 years ago

lo5 commented 2 years ago

This doesn't work in v0.13+:

# ## Open web pages in an existing view
# Pass a URL to `view.jump()` with `target=` set to the name of the view to replace the contents of that view.
#
# In the example below, the `name` of the web view is set to `'example'`,
# and the `view.jump()` call uses `'example'` as the `target`.
def open_web_page_existing(view: View):
    view(
        'Click Continue to open Wikipedia in the web view below.',
        box(mode='web', name='example', path='https://example.com')
    )
    view.jump('https://en.wikipedia.org', target='example')

A redraw that causes the example frame to be momentarily non-existent when jump() is invoked.