Visual Attributes in Oracle Forms 5
Posted on 2000-02-29
I have got a multi record block displayed. Each record has an attribute for Status, there are different Statuses eg, REQUESTED, ASSOCIATED, ASSIGNED, etc...
What I want to do is somehow when Oracle Forms retrives the records for them to be displayed in the block in different colours depending upon the status, eg, all rows with status of REQUESTED should be RED, ASSOCIATED should be YELLOW, etc...
I have written the following code to achieve this but everytime I issue a NEW_BLOCK command it takes a couple of seconds for it to process the code as I feel it is very long winded...
Does anyone know of an easier and more efficient way of doing this??
Here is what I have written:
I have 3 Visual Attribute colours; RED, YELLOW AND GREEN
-- this procedure loops through the block starting at the topmost record and then working down and setting each item's colour in the record. It calls another Procedure to actually set the colour of an item according to the Status.
PROCEDURE SET_STATUS_COLOURS IS
TOP_MOST_RECORD := GET_BLOCK_PROPERTY('CHANGES', TOP_RECORD);
BOTTOM_MOST_RECORD := GET_BLOCK_PROPERTY('CHANGES', CURRENT_RECORD);
-- Loop through from top to bottom and set each row's colour
FOR THIS_REC IN TOP_MOST_RECORD..BOTTOM_MOST_RECORD LOOP
-- sets the an item's colour property. So this Procedure is called for every field in every row.
PROCEDURE Set_Row_Color_Attributes (IN_STATUS IN VARCHAR2,
IN_ROW_COUNT IN NUMBER,
IN_COLUMN_NAME IN VARCHAR2) IS
IF IN_STATUS = 'REQUESTED' THEN
SET_ITEM_INSTANCE_PROPERTY(IN_COLUMN_NAME, IN_ROW_COUNT, VISUAL_ATTRIBUTE, 'RED');
IF IN_STATUS = 'ASSOCIATED' THEN
SET_ITEM_INSTANCE_PROPERTY(IN_COLUMN_NAME, IN_ROW_COUNT, VISUAL_ATTRIBUTE, 'YELLOW');
IF IN_STATUS = 'ASSIGNED' THEN
SET_ITEM_INSTANCE_PROPERTY(IN_COLUMN_NAME, IN_ROW_COUNT, VISUAL_ATTRIBUTE, 'GREEN');
What I need is someway of actually processing the whole row in one go rather than each individual item at a time... is there anyway to do this?? Am I missing some really basic means of doing this?? Please can someone help???
Pardeep (BT Software Engineer)