logo elektroda
logo elektroda
X
logo elektroda

Web GUI Customization: Creating Web Buttons and Handling Click Events and Renaming Set! Button Label

jkwim 267 1
ADVERTISEMENT
  • #1 21633366
    jkwim
    Level 13  
    I have some questions about Web GUI customization:

    I have a Channel setup for GUI like this:

    Channel SwitchFlag1 value input with numeric box and blue “Set!” button

    When you click Set! button the channel value get updated and I can get an addChangeHandler to recognize the change. That works fine.

    I want to be able to set few Channel values like this and then finally execute a command alias from the script.

    Questions:

    1. Is there a way to create a web button on the GUI and when clicked trap that click in the script (some sort of event handle or channel value change)?

    2. Is there a way to change the label of the "Set!" button to something else?

    Added after 3 [hours] 46 [minutes]:

    Found this code snippet from another thread:

    startDriver httpButtons
    setButtonEnabled 0 1
    setButtonLabel 0 "Open Config"
    setButtonCommand 0 "*/api/lfs/cfg.html"
    setButtonColor 0 "#FF0000"


    That solved the Question 1.

    Now I have this issue:

    I setup a channel to store a timer value:

    setChannel 19 3600
    setChannelType 19 TimerSeconds
    // Add a label in GUI
    setChannelLabel 19  "<b><span style='color:orange'\>Delay Time for switch 1</span></b>"
    


    However on the GUI it does not give an option for changing the value:

    GUI screen with a timer label and input for changing SwitchFlag1 channel

    How can I create a changeable channel value on the GUI?
  • ADVERTISEMENT
  • #2 21634040
    jkwim
    Level 13  
    Question 3:
    How do I concatenate text strings in to a Channel Value

    eg:
    setChannel 30 "Text String"$CH29
ADVERTISEMENT