htp.p ((APEX_ITEM.POPUP_FROM_QUERY (p_idx => 2, p_value => '', p_item_id => 'dept_name', p_lov_query => 'SELECT dept department, dept_id id FROM departments WHERE dept_location = ''USA''', p_item_label => 'dept_name'))); htp.p ((APEX_ITEM.POPUP_FROM_QUERY (p_idx => 2, p_value => '', p_item_id => 'emp_name', p_lov_query => 'SELECT emp emp_name, emp_id id FROM employees WHERE department = :dept_name', p_item_label => 'emp_name')));
I only put the relevant lines here, there are actually trios of lines, one with p_idx = 1, and one with p_idx = 4(apparently you need to leave one for the LOV) but these are all display only. When saving I reference them with apex_application.g_f01(i) where you replace 1 for the p_idx.
I have tried replacing the :dept_name with just about everything. apex_application.g_f02(1), dept_name(the p_item_id), g_f02(1), f02(1), f02_0001(when inspecting the item in consol this shows as id). I have tried all these and all these with ':' in front. I have also tried them just included in the parentheses of the select, and by doing 'select ..... where ..= ' || :dept_name || ''''. None of this seems to work, and I couldn't find anything online or within the documentation for APEX_ITEM