Can I change a button’s value text to create an auto update ON/OFF toggle button? I also need this toggle button to make a call to RpSetRefreshTime() so that I can toggle web page updating either on or off.
I have not found a way to alter the buttons value text field from AWS. However, I can do it by using a javascript function and type=“button”. Problem is, AWS needs a type=“SUBMIT” button in order to get a callback. When I use type=“submit”, my javascript onclick gets called twice for some reason which nullifies the toggle effect. It may not be possible to use javascript and a submit button callback at the same time?
I finally figured out a way to do a toggle submit button that can toggle a C/C++ variable and change the buttons text. I could do this previously with just javascript, but it has no support for interfacing with the C interface code. One solution I’ve found is to use RpDynamicDisplay and just have dual buttons (one of which won’t be shown when in the opposite mode)
Then in your submit handler, just check for which button called submit:
char *whichSubmitButton;
// get the value on the submit button presses (all submit button presses come to this function)
whichSubmitButton = RpGetSubmitButtonValue(theTaskDataPtr);