Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Persistence of dynamically created forms

$
0
0

Hello,

in the Dash application, dcc.RadioItems and multiple dcc.DropDowns are created dynamically depending on how many jobs a user starts. Using the persistence prop, Dash persists the combination of user selections for those components. The persistence_type is set to ‘local’. The Dash application stores existing jobs in a dcc.Store and uses this store to initialise the page_layout, i.e. after initialisation the page again contains the same number of dcc.RadioItems and dcc.DropDowns as before a page refresh / closing the browser. This re-initialisation defines the components in the exact same manner, as they have been initially created during the user session in which the corresponding jobs have been started by the user.
However, the persisted values for dcc.RadioItems and dcc.DropDown are lost during that re-initialisation. Since callbacks need to be declared in advance and, thus, cannot dynamically depend on the runtime behavior of the user (the dcc.RadioItems and dcc.DropDown components are created at runtime and depend on user input), there is to my knowledge no straightforward way in also correctly initialising the values of dynamically created dcc.RadioItems and dcc.DropDowns after page refresh or closing the browser.
In other terms, it seems to me, that a link between the previously existing dcc.RadioItems and dcc.DropDowns before a page refresh and the newly created (based on the content of dcc.Store) dcc.RadioItems and dcc.DropDowns is missing. Do you have any idea in handling this issue in a smart and fast way without falling back to a custom dcc.Store solution?

Best regards

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles