I am trying to understand how APEX handles Switch page items in the DOM and how to get the current value/state of a switch page item. I have the switch set up to use values of 'Y' or 'N'.
When looking at the DOM for the sample app I created, whenever I toggle the switch to the "off" or "no" position the input value (in HTML DOM) does not seem to update from 'Y' to 'N' or vice versa. I do not see any hidden input when using the switch page item, like I do with the checkbox page item.
I created a sample page/app here to better show what I mean. If you toggle the native switch page item, the value always seems to be 'Y'. But when I submit the page (submit button), I see the correct value saved in session state, when the page is reloaded. So how is the switch value set/fetched? The DA mentioned above uses the following code:
let switchVal = $(this.triggeringElement).val();
alert(switchVal);
What am I misunderstanding? How do I get the current value of the switch item based on its toggle state? Is there a hidden input somewhere in the DOM that I am missing?