antonpug
antonpug

Reputation: 14296

How to create a value-responsive checkbox in Oracle Apex?

I have a page with a few fields, loaded from a DB table, such as:

Name:   John Smith
ID:     jsa44
State:  MA
--Hidden--ActiveUser:yes

I want to display a checkbox that is checked when activeuser is yes and unchecked when activeuser is no. Also, I want to change the value of activeuser whenever the checkbox check status changes.

How would I do this?

Upvotes: 1

Views: 4421

Answers (1)

Tony Andrews
Tony Andrews

Reputation: 132680

Instead of having ActiveUser as a hidden item, make it a Checkbox item with these attributes: enter image description here

(Note Display Extra Values set to No).

Then add a computation like this: enter image description here

(My item was called P1_X). This computation handles the fact that the unchecked value of a checkbox is always NULL, converting that to 'no'.

Upvotes: 3

Related Questions