How to get feedback from front-end? #656
Replies: 2 comments
-
@HigorFerreira This is perhaps related? #678 Typically, the Py code sits in the single IPython thread executing the code cell, which makes the code that updates the py traitlet hang until the code cell has finished executing. Which it will never do because it is waiting for the traitlet. A solution (via @gereleth) was to use https://github.com/Kirill888/jupyter-ui-poll . |
Beta Was this translation helpful? Give feedback.
-
I tried to reproduce this issue to help - used create-anywidget with React option and pasted in the provided code. But this resulted in unrelated errors showing up. This question really needs a minimal reproducible example. |
Beta Was this translation helpful? Give feedback.
-
Hello, I hope you all are doing well.
I'm trying to create a widget that acts as a sort of dataframe manager. Specifically, I'm working on implementing a widget that paginates large dataframes using "@anywidget/react."
In my backend Python widget code, I have the following:
Notice that I have an observer that triggers if any trait changes (I expected this to trigger when I modify something on the front-end). When a change occurs, the observer calls calc_df_part, which updates the pagination through self.df_part (a JSON string that I display to the user).
However, when I update a state like page_index on the front-end, the observer doesn't trigger. I have a basic front-end setup for testing:
**
I have tried several patterns like on_trait_change and on_msg, but nothing seems to report back from the front-end.
When i click on Icrease page_index, i expected to update df_part
Beta Was this translation helpful? Give feedback.
All reactions