EditBox Action Scripts

Is there a way to run an action script on an EditBox? I currently have a button to confirm the text entry before running any scripts but is there a way to have the script run without the button? It would be nice if the script could run once the edit box value changes

Parents
  • Hi Caroline,

    If I understand your inquiry correctly, you should be able to do this via a named symbol script. Quick example procedure:
    1. Create a new graphic
    2. Embed an EditBox
    3. Right click anywhere on the canvas within your graphic --> Scripts
    4. Click on the plus sign to create a named script and name it whatever you want
    5. Enter the edit box's name .Value as the Expression
    6. Change the trigger to DataChange
    7. Enter whatever script you want ran when the edit box value changes

    Example Configuration:


    Let me know if this makes sense for your situation, or if you need any clarification. 

Reply
  • Hi Caroline,

    If I understand your inquiry correctly, you should be able to do this via a named symbol script. Quick example procedure:
    1. Create a new graphic
    2. Embed an EditBox
    3. Right click anywhere on the canvas within your graphic --> Scripts
    4. Click on the plus sign to create a named script and name it whatever you want
    5. Enter the edit box's name .Value as the Expression
    6. Change the trigger to DataChange
    7. Enter whatever script you want ran when the edit box value changes

    Example Configuration:


    Let me know if this makes sense for your situation, or if you need any clarification. 

Children
  • Hi Adam, the main reason I am doing this is to avoid unnecessary clicks for the operators. After doing this, the dream would be to tab into the next text entry field. I am seeing the halo to show that the focus is on the next EditBox but it is not fully focused where I can just start typing without clicking again. Do you know a way I can get around that?

  • Hi Caroline,

    After some testing today, I don't believe this will be possible. It seems to be a limitation with EditBoxes. Other elements, such as buttons, can be tabbed to and then activated via the Enter or Space key. EditBoxes, on the other hand, are only highlighted when tabbed to, with no way of interacting with them to edit the text, aside from using the mouse. My guess is that this would require an enhancement request to AVEVA to get it working.

    The other thing I thought about was simulating a mouse click at time of highlighting, but there is no way of doing this natively within InTouch, so I won't go to much further into that. 

    If anyone else has any workaround to get this to work, feel free to share. 

    My recommendation would be to use TextBoxes instead. They function similarly to EditBoxes, but when tabbed to, you can start typing immediately. The only caveat is that operators would need to press Enter when done typing for the assigned reference to update, unlike EditBoxes, which update in real time as they type. You'll need to weigh the pros and cons of both options for your application.