The best way to refresh a tab / group / element

Hello there (again)

Thanks for all your help to date, but sorry I have another question (is there a weekly limit?!)

Could someone tell me the best way to make sure tabs/groups update when something changes on them. (the flow I've uploaded will make this a bit clearer).

I only just realised (I am v green) that changes in a template ui using javascript will not automatically update other copies of that page - ie if 2 browser windows are looking at the same tab and you change something in one, it doesn't update the other, unless you refresh the page.

I have used the ui control node to refresh the page when a change is made which solves that problem, but this seems a bit naff because, in the case of this flow, it makes the record button flash when you click it.

Could someone possibly tell me a better way / the right way of doing this?

Kind regards

Paul
flows (9).json (7.5 KB)

Sorry I forgot to say that the reason I have used a ui template to make a button, is because it seems to give you more control of colours / images / animation etc...

Use the ui-control node, specifying an empty tab to refresh the current page/tab. Please read the help of the ui-control node for details.

Hi mickym2

Thanks for your reply, but that's what I did in the uploaded flow. The problem is, there is a little blip as the page refreshes which is quite obvious. This doesn't matter so much if the state only changes once, say the colour of the background when you click on something, but I have a page that changes every second or so as it receives data from a sensor. So if I use the ui control to refresh the page as each bit of data comes in, it is basically flashes(refreshes) continuously ;(

Coincidentally I think, I have just found the solution, so I thought I would post it in case it helps anyone else:-

(forgive the wrong terminology)
when a message is sent from the dashboard to the flow it contains a 'msg.socketid' which is specific to the session (meaning I think, the browser instance) so when it comes back to the dashboard it only affects the browser instance it was sent from.

If you want it to affect all instances you need to delete this field.
(I don't think this is the case for all the dashboard nodes, but certainly the ui template)
flows (11).json (7.3 KB)

See the uploaded flow for info (if you open 2 windows you can see it changes both pages)

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