Multi-select List Item in Oracle APEX | Checkbox Group
In my previous post, I explained how to use Shuttle Item. In this post, I will explain how to use another multi-select item Checkbox Group.
In Oracle APEX, Checkbox Group displays multiple values as checkboxes and enables end-user to select multiple values. Like the Shuttle item, the Checkbox Group also stores values of checked boxes in a colon-delimited string. We need to provide a list of values for values displayed as checkboxes.
How to create a Checkbox Group?
- Create a VARCHAR2 column having a large size as it stores a colon-delimited string.
- Navigate to an APEX page and create a page item in a region that is based on the database table.
- Change its type to "Checkbox Group".
- Go to the "List of Values" section in the property section and select the list of values type. Here I selected "Static Values".
- Click on the "Static Values" and a popup will open. Add Display Value and Return Value in this popup as shown below.
- Enter the number of layout columns used to display checkboxes in the "Number of Columns" property. For example, a value of 3 would display three columns of checkboxes. The default value is 1 which means all the checkboxes would display in one column.
- Save the changes and run the page.
The values of these selected checkboxes are stored as a colon-delimited string. Refer to my previous post where I explained how to use colon-delimited values in SQL query and PL/SQL block.
Checkbox Group is useful when there is a few list of values available to select from. For more list of values, Checkbox Group is not a good option from a UI perspective as there are lots of checkboxes on the form.
Comments
Post a Comment