Switch to desktop version  
setEwonTagVal only works if tag is displayed? - Printable Version

+- Ewon Technical Forum (https://techforum.ewon.biz)
+-- Forum: Development (https://techforum.ewon.biz/forum-50.html)
+--- Forum: Custom Web Pages/viewON/Talk2M Visualization (https://techforum.ewon.biz/forum-55.html)
+--- Thread: setEwonTagVal only works if tag is displayed? (/thread-382.html)



setEwonTagVal only works if tag is displayed? - AngelaT - 30-08-2017

Has anyone seen this before?  I have a project with two views.  They are nearly identical.  Each has a group that consists of a rectangle with some text in it.  In each case, I have added an action so that if the group is clicked it uses a sendEwonTagVal to update a tag to particular value.  In one view, the text is fixed.  In the other view, there's an animation to display the value of that tag.  When I click on my group in the view with the fixed text and then check the tag value in the eWON's viewIO page, the tag hasn't changed.  When I click on my group in the view with the dynamic text and then check the tag value in the eWON's viewIO page, the tag has been set to the new value.  

I've attached the project in case anyone wants to take a look.  Maybe I did something stupid and am just not seeing it.  The view Home works as expected, but the view Dose2 does not. I even tried adding a commitEwonTagChanges into the mix to see if that helped, but it didn't.


RE: setEwonTagVal only works if tag is displayed? - Ludo - 31-08-2017

Hey Angela,

The reason is because on the dynamic view, viewon is communicating tags with the eWON at page load.
Your "Click me!" is telling viewon that he's linked to "ButtonPress" tag.

On the other static view, viewon isn't receiving instruction that there are links between elements and tags so it just cuts the polling/pushing system (see attached picture).


To solve this, you could add above your code in the static view the line "getEwonTagVal('ButtonPress');" to have something like:


Code:
getEwonTagVal('ButtonPress');
setEwonTagVal('ButtonPress',3);



RE: setEwonTagVal only works if tag is displayed? - AngelaT - 31-08-2017

Thank you!!! I figured there was just a piece I was missing. Thanks for your help.