Hello, I have a complex problem with "interference" between widgets in the same tab
To demonstrate and explain the problem I am facing, I have created a simplified flow. In short, the html code in the ui_template nodes have two "sections" that I show/hide using style.display = "none" and style.display = "block" respectively. The control is triggered via drop down messages sent to the nodes. The ui_template nodes receive the messages via the scope
This works fine when I have the ui_templates and related drop downs in separate tabs but not if I have them in the same which I need for the project I'm currently working on
When in separate tabs, all is ok, both can be controlled individually without interfering each other
The attached flow is configured with separate tabs where it is working. To recreate the problem, just edit and move one of the dashboard group nodes so they are all on the same tab
Greatful for any hints getting around this
Best regards, Walter
The uniqueness must be across html DOM. The other tab does not exist so there is only one ui_template. If you put more than one in same tab, you are creating elements with same id's cos in the view A and view B you have elements with same ids. ("div1a" ...)
If you follow the structure of this example you can make one ui_template and copy it how many times you want. The uniqueness is guaranteed by the scope id.
So I am on the way I believe!! The two widgets seem to be independent now, but I would like to ask you one more question, is about setting properties of the html. The example syntax given like $("#my_"+scope.$id).html(msg.payload); works fine for changing the text, that I have tested
But now I need to change some other attributes. Normally I would from javascript do document.getElementById
As example I have tried this but it seems not working document.getElementById($("#div2a_"+scope.$id)).style.backgroundColor="red";
I have also tried several other syntaxes but no success, so if you could hint how I can change such attributes as in the example below I would be very happy