Node/flow redraw

Hi everyone,
I'm creating some custom nodes, and running into a small issue with the label function of the custom node in the html. I have some utilities which are loaded at runtime using the getScript in the html file (much like other posts had pointed out being done in the geofence node). This was jst to keep the html file smaller, there are quite a few utilities. This all seems to work just fine.

The issue I'm running into with the label is that to create a more meaningful node name one of the loaded utilities is being called. Since the loading is async, initially when the flow is first loaded, the label is populated before the getScript completes, hence fails and the generic label name is shown.

I also noticed that if I force a redraw by switching flow tabs, then the label is re-queried and my utility can then successfully be called. Is there a way I can force the redraw of the node from within the html portion of the custom node?

I've concluded that this is probably not a good idea, and maybe not doable for that reason. Having the clients force a redraw would affect other connected clients. Which is probably why I'm not able to do this from the client side.
I've reverted my code for the node to all be within the html portion of the custom node, it makes the file large, but at least it works.
One method that might have worked is if I added a post to ask the node red server to redraw, but probably just not a approach anyways.

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