Facility Control

 View Only
  • 1.  Add additional values from dashboard

    Posted 08-09-2018 15:32

    I'm certain this is possible, but I'm scratching my head on how. Basically, using 1 parameter, I'd like to add whatever's entered there, into another parameters' list. (attached). Grateful for your help.




  • 2.  RE: Add additional values from dashboard

    Posted 08-09-2018 15:41
    Can you give me the code? Then I'm pretty sure I can give you a sollution pretty fast.
    Allmost willing to bet this is based on the constraints I think has been answered a billion times in different ways allready :P

    You can also take a look here:
    https://discussions.rossvideo.com/forum/default-forum-gc1/dashboard-gc43/16326-basketball-stats-panel-need-help-populating-dropdowns

    Dropdowns populated by other inputs.
    #DashBoard


  • 3.  RE: Add additional values from dashboard

    Posted 08-09-2018 15:53
    Below is the code I have right now. Not much there. I looked at that post, but it looks like he's referencing multiple boxes combining into 1. What I'd like is to add to the list from a single source and then stored. Perhaps it's the same technique.





    1
    Entered Text 1





    Entered Text 1
    Entered Text 2





    #DashBoard


  • 4.  RE: Add additional values from dashboard

    Posted 08-09-2018 15:54

    For a simple list of strings, here is a working example that copies the previous choice values into the new constraint before updating.

    <abs contexttype="opengear">
       <meta>
          <params>
             <param access="1" constrainttype="STRING_CHOICE" maxlength="0" name="Test" oid="Test" type="STRING" value="A" widget="list">
                <constraint>A</constraint>
                <constraint>B</constraint>
                <constraint>C</constraint>
             </param>
             <param access="1" maxlength="0" name="Entry Field" oid="Entry_Field" type="STRING" value="Test" widget="text"/>
          </params>
       </meta>
       <param expand="true" height="248" left="36" oid="Test" scroll="vertical" top="139" width="289"/>
       <button buttontype="push" height="43" left="227" name="Add" top="92" width="92">
          <task tasktype="ogscript">var c = params.getConstraint('Test');
    var choices = c.getChoices();
    
    var newChoices = [];
    for (var i = 0; i &lt; choices.length; i++)
    {
       newChoices.push(choices[i]);
    }
    
    newChoices.push(params.getValue('Entry_Field', 0));
    params.replaceConstraint('Test', params.createStringChoiceConstraint(newChoices));</task>
       </button>
       
    <param expand="true" height="38" left="35" oid="Entry_Field" top="94" width="185"/>
    </abs>
    

    #DashBoard


  • 5.  RE: Add additional values from dashboard

    Posted 08-09-2018 15:56
    Well, there you go.. James is allways ready to help! :D
    #DashBoard


  • 6.  RE: Add additional values from dashboard

    Posted 08-09-2018 16:24
    Wow, thank you guys. Will try this out right away.
    #DashBoard