Viewon - delete tag value on Viewon by clicking other button

Hi,
How I delete the value of another tag on Viewon by clicking on a button ?
I test, I test, I can’t resolve…
By Java ? Other ?
Thank you,
Rémi

Script => ?

var Button = getEwonTagVal(‘TEST_TAG’);
setViewOnTagVal(‘TEST_TAG’, 0);
commitEwonTagChanges();

See picture :

Hi Remi,

I’m not completely sure I understand what you are trying to do.

If you want to set the value stored in a tag to 0 when you press a button in viewON, then you have two choices.

If the tag is a boolean tag, you can simply use the “Send command” action, associate it with your tag, and set the value to send to 0.

If the tag is an analog tag, you can similarly use the “Send command” action, but instead of associating it with your tag, associate it with a script. In the script, you can say:
TEST_TAG@=0

There is an example of this in Chapter 8 of the viewON getting started guide.

If what you want to do is have a button set the value inside a text editor like in your picture, let me know. That process is a little more complicated.

Angela

Hi,
humm I don’t understand exactly…
I have a tag in the rectangular (here value), It is a tag on Ewon. TAG$ = ‘viewon!’.
I push a value on Ewon when I manualy write a value in rectangular.
When I click on the button below, button ‘TEST’, I want that the tag TAG in rectangular disappeared or to set at 0.

Thank you
Rémi

I understand now. TEST_TAG$ isn’t a tag. It is a string BASIC variable. To have you button both update the value of TEST_TAG$ and empty the value of the text input box, you will need to add two actions to the button - one to update the string on the eWON and one to change the contents of the web page.

The first is a SEND COMMAND action where the action is the BASIC script
TEST_TAG$=""

The second action is a Execute viewON Script where you update the value attribute of your text input box.
document.getElementById(“UID_xxxx”).value="";
where xxxx is the Id of the element. You can find the Id in the Graphical properties of the element. In that field, you’ll see something like “UID_12345Container”. You will drop the “Container” portion and use “UID_12345” as the id of your element.

Hi,
hooo I think that is working now !! :slight_smile:
(Not with “ and ” but with " and " on UID)
Thank you Angela ! I send this answer to our customer.
Rémi