Home » Developer & Programmer » Forms » acces value of specific column from current record
acces value of specific column from current record [message #85115] Wed, 02 June 2004 15:51 Go to next message
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;
Re: acces value of specific column from current record [message #85122 is a reply to message #85115] Thu, 03 June 2004 00:55 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
This can be achived by a Minor change to your code though the approach taken by you for Populating the block is not the best.
Anyways chnage the code:
my_current_value := :SYSTEM.CURRENT_VALUE;

To
my_current_value := :masterblock.deptno;

HTH

Regards
Himanshu
Re: acces value of specific column from current record [message #85123 is a reply to message #85115] Thu, 03 June 2004 01:59 Go to previous message
hudo
Messages: 165
Registered: May 2004
Senior Member
Thanks, it works now.

Maybe you can give me some advice for a better approach to populate the block

Regards, hudo
Previous Topic: Debuging in Forms6i
Next Topic: tabular display of opened forms, control of number of users, dynamic sort
Goto Forum:
  


Current Time: Wed May 01 11:54:21 CDT 2024