Skip to main content
This blog will show you how to implement read-only and disabled switch widgets in Oracle APEX.  Unlike other page items, the switch widget is more tricky because it transforms when it is read-only and has a built-in validation that can be frustrating to work with.

Examples

essay to do good conflict resolution topics essay source url quanto custa o viagra cialis click here que pasa si una mujer se toma una pastilla de viagra drugs to use with viagra essay template word mac are cover letters necessary for resume https://greenechamber.org/blog/the-glass-castle-thesis/74/ ingerasii generic cialis https://thembl.org/masters/my-country-myanmar-essay/60/ how to write a sad love poem gold feature presentation https://scottsdaleartschool.org/checker/connective-words-for-essays-list/33/ blue pill 031 source essays on beauty rediscovers the male body follow precio viagra farmacias similares https://heystamford.com/writing/dissertation-template/8/ https://chanelmovingforward.com/stories/sample-of-a-business-plan/51/ business writing courses toronto source link enter site https://greenechamber.org/blog/resume-esl-lesson-plan/74/ https://eagfwc.org/men/tiger-king-herbal-viagra/100/ success in business essay good ways to start an essay about yourself https://vabf.org/reading/essay-on-non-farming-activities/250/ https://rainierfruit.com/viagra-video-kostenlos/ planning to write an essay There are multiple ways to display a switch widget as read-only or disabled.  We will examine the main iterations below:

1.)  Read-Only Set to Always

    • Transforms from the default switch widget to text that reads “On” or “Off”
    • Not the most user-friendly
    • Not the most intuitive because the default values are “Y” and “N”
    • This will throw an error on page submit unless you change the page item settings for the switch widget

2.)  Dynamic Action – Disabled

    • The switch widget displays as normal, but it is grayed out
    • Disabled items cannot hold a value in session state
    • This will throw an error on page submit

The Best Solution – Dynamic Action JavaScript

  • The widget looks disabled, but still holds a value in session state
  • There are no errors on page submit
  • Create a Dynamic Action on Page Load and use this JavaScript:

$("#P2_SWITCH_ITEM").parent(".a-Switch").addClass("apex_disabled").attr('tabindex','-1');

Learn More

Disclaimer:
We do not take responsibility for any unintended or unwanted consequences in your instance of Oracle, Oracle APEX, or related products as a result of reading our blogs or following our guides. Though the information is fully tested and generally safe to use, our lawyers really have a thing against admitting potential wrongdoing. If it makes you feel any better, one time I convinced them that the reason The Matrix broke so many box office records was because it accurately portrayed how real-world hacking was done.  I then told them that it is no coincidence that hacking attacks have grown exponentially since it was released.