简体   繁体   中英

Create dynamic LOV in oracle apex

Im creating an application. I need to use a multi select list for tabular form.

Below is a screen shot of the tabular form.

*在此处输入图片描述*

In this i created a multi select list, using

HTMLDB_ITEM.SELECT_LIST_FROM_LOV_XL(9,' ','USERNAME','multiple size = "3"')

Soon after "Asign users" is clicked, It goes to another page where User names are selected, and inserted into the table user_det_t and an id work_assignment_id is generated using trigger.

and that id is shown up in the tabular form.

Now for that work_assignment_id there will be a set of user ids which are assigned in that new screen, meaning.. a process has 1 assignment id.. which has many user name assigned. Now I need to show the users for each process in the corresponding multi select list, just for display purpose.

In order to do that, we need to call an LOV, I created an LOV named "USERNAME" called in this.

HTMLDB_ITEM.SELECT_LIST_FROM_LOV_XL(9,' ',' USERNAME ','multiple size = "3"')

Now the problem is I couldnt create a dynamic LOV by that way.

Can anyone help me out of this?

Instead of using SELECT_LIST_FROM_LOV you could use SELECT_LIST_FROM_SQL (and _XL if you think the return will be >4000 characters).

From the example:

SELECT APEX_ITEM.SELECT_LIST_FROM_QUERY(3,job,'SELECT DISTINCT job FROM emp')job 
FROM emp

So you could use (for example)

SELECT APEX_ITEM.SELECT_LIST_FROM_QUERY(3,job,'SELECT username FROM work_user_assignments WHERE assignment_id = '||id) users 
from x

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM