• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Point Value Link Trigged by button or page change

    Dashboard Designer & Custom AngularJS Pages
    3
    6
    1.9k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      Bhanner
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        Hi Billy,

        Looks like there are a couple issues,

        1. 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')"
        2. There is extra junk in your directive. The =""="" at the end is nothing but trouble.
        1 Reply Last reply Reply Quote 0
        • Jared WiltshireJ
          Jared Wiltshire
          last edited by Jared Wiltshire

          Using ui-sref and ng-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>
          

          Developer at Radix IoT

          1 Reply Last reply Reply Quote 0
          • B
            Bhanner
            last edited by

            @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

            Jared WiltshireJ 1 Reply Last reply Reply Quote 0
            • Jared WiltshireJ
              Jared Wiltshire @Bhanner
              last edited by

              @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

              Developer at Radix IoT

              B 1 Reply Last reply Reply Quote 0
              • B
                Bhanner @Jared Wiltshire
                last edited by

                @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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post