Display additional information for Shuttle Item


Problem: user wants to display some additional information on a selected value in a shuttle menu


solution

1. Add the following to "Execute when Page Loads":

$("#P44_SHUTTLE_LEFT,#P44_SHUTTLE_RIGHT").click(function(){
f_emp_detail($('option:selected').val());
});

2. Add the following to "Function and Global Variable Declaration":

function f_emp_detail(pThis) {
var get = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=get_emp', 44);
get.add('P44_EMPNO', pThis)
gReturn = get.get();
get = null;
$s('P44_DEPT', gReturn);
}

3. Create an On demand application process called get_emp:

DECLARE
lv_dep VARCHAR2(4000);
BEGIN
SELECT deptno2
INTO lv_dep
FROM emp
WHERE empno = :p44_empno;
htp.p(lv_dep);
END;


(When the user clicks a value in the Shuttle the Department is displayed)


Comments