Closed wKollendorf closed 3 months ago
Just learnd, that set_props in a callback only modifies the properties of components on the client side. Also new components are only available on the client side. So this issue can be closed. Anyway, is there a way to make set_props work on server side too?
Hi - I am closing this as a bug report but @Coding-with-Adam is there a way to make set_props
work on the server side?
Context The following code is a simplified example of the real application. The layout initially contains a root div and inputs. By using pattern matching and set_props the callback function can be setup in a general manner. Anyway, when triggering the callback by a button the root div will be populated by any other content like another div and more inputs. The newly created inputs then trigger the same callback and the layout is further updated. A nested structure.
The ID is like this:
{'type': 'ELEMENT_TYPE', 'eid': 'ELEMNET_ID, 'target': TARGET_ID'}
In the following example works like this:
failing example:
This works for Button1 as expected. But when clicking Button2 (which was created by Button1) the mentioned TypeError occures. When inspecting the console, it can be seen, that the itempath is undefined.
Changing the target of Button1 to content3 works (just replace the line for dbc:Button within the callback). So the itempath for Button2 is found and the callback for the new input works.
working example:
pip list | grep dash
Describe the bug The itempath for content2 Div is undefined and concat in getInputHistoryState fails. The itempath is undefined because the component is not present within the store. So it looks like set_props does not update the store?
Expected behavior
The message 'OUTPUT for content2 from button2' should appear in Div with id {'type': 'Div','eid': 'content2', 'target': ''}.