Point Value Link Trigged by button or page change
-
Hi,
I am wanting to set it up a button so when pressed it opens up a page and Transfers the current value of one point value to a second one.This is what i've got so far but it doesn't appear to work
<ma-get-point-value point-xid="Visitor-Number-Selected" point="Vist_Num"></ma-get-point-value> <ma-button id="New-Vist" style="position: absolute; left: 1217.99px; top: 1002.03px; z-index: 4;" raised="true" ui-sref="scada.vistorSetupPage" label="New Visitor" ng-click="Vist_Num.setValue("Visitor-Number-Selected-Script")" =""=""></ma-button>
Thanks in advance
BIlly -
Hi Billy,
Looks like there are a couple issues,
- Your quotes in the ng-click item are all double quotes. You need to use one type of quotes inside the other, like,
ng-click="Vist_Num.setValue('Visitor-Number-Selected-Script')"
- There is extra junk in your directive. The
=""=""
at the end is nothing but trouble.
- Your quotes in the ng-click item are all double quotes. You need to use one type of quotes inside the other, like,
-
Using
ui-sref
andng-click
together wont work correctly I suspect.Try this.
<ma-get-point-value point-xid="Visitor-Number-Selected" point="Vist_Num"></ma-get-point-value> <ma-button id="New-Vist" style="position: absolute; left: 1217.99px; top: 1002.03px; z-index: 4;" raised="true" label="New Visitor" ng-click="Vist_Num.setValue(myOtherValue); $state.go('scada.vistorSetupPage')"></ma-button>
-
@jared-wiltshire
Hi jared,
The code you gave me did work but it set the value of the first tag to 0 regardless of what the value of the second tag was<ma-get-point-value point-xid="Visitor-Number-Selected" point="Vist_Num"></ma-get-point-value> <ma-get-point-value point-xid="Visitor-Number-Selected-Script" point="Script"></ma-get-point-value> <ma-button id="New-Vist" style="position: absolute; left: 1217.99px; top: 1002.03px; z-index: 4;" raised="true" label="New Visitor" ng-click="Vist_Num.setValue('Script'); $state.go('scada.vistorSetupPage')"></ma-button>
Can you see what i'm doing wrong?i'm a bit stumped if it won't work i have a way to make it work using scripts but i'd rather not use that
-
@bhanner said in Point Value Link Trigged by button or page change:
@jared-wiltshire
Hi jared,
The code you gave me did work but it set the value of the first tag to 0 regardless of what the value of the second tag was<ma-get-point-value point-xid="Visitor-Number-Selected" point="Vist_Num"></ma-get-point-value> <ma-get-point-value point-xid="Visitor-Number-Selected-Script" point="Script"></ma-get-point-value> <ma-button id="New-Vist" style="position: absolute; left: 1217.99px; top: 1002.03px; z-index: 4;" raised="true" label="New Visitor" ng-click="Vist_Num.setValue('Script'); $state.go('scada.vistorSetupPage')"></ma-button>
Can you see what i'm doing wrong?i'm a bit stumped if it won't work i have a way to make it work using scripts but i'd rather not use that
What I gave was an example which you would need to modify. Given the two points which you have included above I can make it more specific. Try this.
<ma-get-point-value point-xid="Visitor-Number-Selected" point="Vist_Num"></ma-get-point-value> <ma-get-point-value point-xid="Visitor-Number-Selected-Script" point="Script"></ma-get-point-value> <ma-button id="New-Vist" style="position: absolute; left: 1217.99px; top: 1002.03px; z-index: 4;" raised="true" label="New Visitor" ng-click="Vist_Num.setValue(Script.value); $state.go('scada.vistorSetupPage')"></ma-button>
You were setting the point to the string value 'Script'. I have modified it to set it to the point value. Note there are no single quotes and we access the point value using
.value
-
@jared-wiltshire
Hi jared,
Didn't realise i needed to add ".value" at the end i have now added it and the button now works as i wanted :) Thanks for you help
Regards
Billy