acces value of specific column from current record [message #85115] |
Wed, 02 June 2004 15:51 |
hudo
Messages: 165 Registered: May 2004
|
Senior Member |
|
|
Hello,
the contents of the table scott.emp is displayed in tabular style in a forms-mask. By doubleclicking on a row, forms should switch to another Block DEPT1 (on another canvas/tab) and display in this mask the corresponding row from scott.dept.
Therefore I use a Block Trigger "WHEN-MOUSE-DOUBLECLICK", but it works only correctly if the focus is on the column deptno from the scott.emp mask before the doubleclicking action.
I'd like to doubleclick for example on the column empno (i.e.: 7369) and the corresponding row should appear in the DEPT1 -mask (row with deptno = 20 ).
How can I do this ??? My actual problem is to access the column-value from scott.emp.deptno from the current record
before the doubleclicking.
Here the contents of my "WHEN-MOUSE-DOUBLECLICK" trigger:
DECLARE
the_button_pressed VARCHAR2(1);
my_current_value VARCHAR(2);
cur_blk VARCHAR2(40) := :SYSTEM.CURSOR_BLOCK;
cur_rec NUMBER;
--top_rec NUMBER;
bk_id BLOCK;
BEGIN
bk_id := FIND_BLOCK( cur_blk);
cur_rec := GET_BLOCK_PROPERTY( bk_id ,CURRENT_RECORD);
--my_current_value := cur_rec;
my_current_value := :SYSTEM.CURRENT_VALUE;
the_button_pressed := :SYSTEM.MOUSE_BUTTON_PRESSED;
GO_BLOCK('DEPT1');
CLEAR_BLOCK(NO_VALIDATE);
--SET_ITEM_INSTANCE_PROPERTY('DEPT1.DEPTNO', CURRENT_RECORD ,VISUAL_ATTRIBUTE ,'GREEN_BACKGROUND');
SELECT deptno, dname, loc
INTO :DEPT1.DEPTNO, :DEPT1.DNAME, :DEPT1.LOC
FROM DEPT
WHERE deptno = my_current_value;
--END IF;
END;
|
|
|
|
|