Closed falkoschindler closed 2 years ago
Since you are updating a Div and not a WebPage, you need to add temp=False when creating container
so that justpy will assign an id to it and you need to tell container
which pages it is on:
container = jp.Div(a=wp, temp=False)
container.add_page(wp)
This is discussed here: https://justpy.io/tutorial/pushing_data/#simple-message-board
Oh, I see. Thanks for your help!
I read about temp=False
some time ago, but wasn't aware that it is crucial in this case.
And I thought a=wp
is equivalent to add_page(wp)
- like a=container
and container.add(...)
seem to be.
It is very difficult to determine automatically which page a component is on. The component can be added to another component that then is added to another component and so on until a component is added to a page. a=wp is just shorthand for add. This adds a component to another component or page as a direct child. add_page is something different. It is a mechanism for the programmer to tell the framework on which pages it will find the component if it wants to just update the component.
I'm a bit lost. In order to update the UI after an asynchronous task finished, the following event handlers return
False
(no page update) and callupdate()
after modifying the UI elements. But somehow the UI does not refresh.When removing
return False
, the elements get updated, but show an outdated state from before the tasks finished.What am I doing wrong?