Custom ui node: how to get synchronisation between sessions and after page refresh

Hi

I'm currently trying to code my first ui-widget. All works so far and it is nearly done thanks to the example I found in ui-nodes.

Now I got one problem: The current state of the widget is not forwarded to different clients / sessions when the values are changed in the dashboard by user input. New messages are sent to all clients and messages from all clients arrive @ the backend.

And after page refresh the current state is lost. The "my little ui node" shows the same behaviour so no help there.

Any quick explanation or example to get an idea how the mechanic is working?

As always thank you for your help.

Chris

I think this is an interesting question/case so it will be great when there is an explanation given. I needed the same earlier but I coded the ui in javascript & html using a standard template node. To send the same information to all connected clients I use websocket. To initiate a client with correct statuses after a page refresh the client sends a websocket command (using the "onLoad" in the body tag) to tell NR to push current statuses "to all" connected clients. In this way I could keep all clients in sync

Finally I found out how to do this with custom ui nodes. If you set the storeFrontEndInputAsState to truethe dashboard does the work for you. It will pass the last state and every new state to all connected clients as normal messages. A little bit tricky (at lest for me) is how to determine if the origin of a message is actual the own message sent by the client to avoid undesired loops. But in the end I found a solution (I think)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.