logo elektroda
logo elektroda
X
logo elektroda

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

jkwim 72 0
ADVERTISEMENT
  • #1 21633366
    jkwim
    Level 12  
    I have some questions about Web GUI customization:

    I have a Channel setup for GUI like this:

    Screenshot of a graphical user interface showing a Set! button and a channel value input field.

    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:

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

    How can I create a changeable channel value on the GUI?
  • ADVERTISEMENT
ADVERTISEMENT