APEX-AT-WORK no image

APEX bug with APEX_ITEM and POPUPKEY_FROM_LOV

Von Tobias Arnhold 3.17.2011
Try to set two POPUPKEY_FROM_LOVs beside each other with the column ids: 2,3

select
APEX_ITEM.CHECKBOX (1,ac.ac_id) as ac_id,
APEX_ITEM.POPUPKEY_FROM_LOV(2,ac.application_key,'lov_apps',50) as application,
APEX_ITEM.POPUPKEY_FROM_LOV(3,ac.system_key,'lov_systems',50) as system
from app_conf ac;

When you run the page then APEX automatically creates a hidden field for the return value of the "popup lov".

The output looks like that:
column "application": Return column id = 2, Display column id = 3
column "system": Return column id = 3, Display column id = 4

If you set a value for column "system" it saves the "return value" in the "display value"-field of column "application".

Workaround: Use at least two numbers in between to avoid this behavior:

select
APEX_ITEM.CHECKBOX (1,ac.ac_id) as ac_id,
APEX_ITEM.POPUPKEY_FROM_LOV(2,ac.application_key,'lov_apps',50) as application,
APEX_ITEM.POPUPKEY_FROM_LOV(4,ac.system_key,'lov_systems',50) as system
from app_conf ac;

Post Tags:

1 One Comment " APEX bug with APEX_ITEM and POPUPKEY_FROM_LOV "

Anthony Rayner 30 March, 2011 10:57

Hi Tobias,

Although this is different behaviour to other APIs, I don't think this is a bug. We document this as follows in the API reference:

Because of the behavior of POPUPKEY_FROM_QUERY, the next index value should be p_idx + 1. For example:

SELECT APEX_ITEM.POPUPKEY_FROM_LOV (1,deptno,'DEPT') dt,
APEX_ITEM.HIDDEN(3,empno) eno


http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_item.htm#CHDHJICI

That said, sorry if this caused you any pain / delay!

Regards,
Anthony.