antonpug
antonpug

Reputation: 14296

How to access value of a select list control in APEX?

I have a select list and a DELETE button. When the delete button is clicked, a query is supposed to run DELETING the selected item from the database. How can I reference the selected item in the select list? I can reference the select list by :P11_ITEMS

Upvotes: 0

Views: 3293

Answers (2)

Ian Carpenter
Ian Carpenter

Reputation: 8626

Using Apex 4.01, I created the following example:

A page with just a select list and a delete button

enter image description here

I select ALLEN and press delete

enter image description here

and you can see ALLEN has now been deleted.

Other than creating the two items, the only other item is a Page Processing PLSQL process, called delete_emp.

enter image description here

The delete_emp process has the following delete statement that references the select list.

enter image description here

Upvotes: 2

WoMo
WoMo

Reputation: 7246

You should be able to reference your selected option by referencing your select list :P11_ITEMS. But if your session state has no current value for this item, your page processes may be out of order. Make sure you have your page process running after page submit (which saves the select list item value to the database for later use).

Upvotes: 0

Related Questions