Highlight a selected row - Solution [message #84885] |
Fri, 07 May 2004 08:01 |
David
Messages: 110 Registered: November 1998
|
Senior Member |
|
|
Hi guys,
If you follow the Oracal help code below you can highlight a row, but not unhighlight it when you select a different row:
DECLARE
cur_itm VARCHAR2(80);
cur_block VARCHAR2(80) := :System.Cursor_Block;
BEGIN
cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
WHILE ( cur_itm IS NOT NULL ) LOOP
cur_itm := cur_block||'.'||cur_itm;
Set_Item_Instance_Property( cur_itm, CURRENT_RECORD,
VISUAL_ATTRIBUTE,'My_Favorite_Named_Attribute');
cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
END LOOP;
END;
Solution:
Instead of using a Visual Atribute and Set_item_instance_property, use Set_item_property like this
DECLARE
cur_itm VARCHAR2(80);
cur_block VARCHAR2(80) := :System.Cursor_Block;
BEGIN
cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
WHILE ( cur_itm IS NOT NULL ) LOOP
set_item_property(cur_itm, current_row_background_color,'r0g0b108');
set_item_property(cur_itm, current_row_foreground_color,'r255g255b255');
cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
END LOOP;
END;
Hope this helps someone. Let me know if you have any questions.
Cheers,
Dave
|
|
|
|
Re: Highlight a selected row - Solution [message #84889 is a reply to message #84888] |
Fri, 07 May 2004 12:03 |
David
Messages: 110 Registered: November 1998
|
Senior Member |
|
|
Hi Ram,
I guess it depends on what you are going for. If you are using the same code throughout multiple blocks then a visual attribute might be the way to go (especially if you are changing other things like font weight, font size, etc.). It's really a matter of preference, but for highlighting just a row, I think it is simpler to do it in the code.
Cheers,
Dave
|
|
|