Solved

Visual Attributes in Oracle Forms 5

Posted on 2000-02-29
16
4,345 Views
Last Modified: 2012-05-04
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 NUMBER;
  BOTTOM_MOST_RECORD NUMBER;

BEGIN


  TOP_MOST_RECORD := GET_BLOCK_PROPERTY('CHANGES', TOP_RECORD);

  LAST_RECORD;

  BOTTOM_MOST_RECORD := GET_BLOCK_PROPERTY('CHANGES', CURRENT_RECORD);

  FIRST_RECORD;

    -- Loop through from top to bottom and set each row's colour

    FOR THIS_REC IN TOP_MOST_RECORD..BOTTOM_MOST_RECORD LOOP

       Set_Row_Color_Attributes (:CHANGES.STATUS,
                                 THIS_REC,
                                 'CHANGES.CHANGE_ID');

       Set_Row_Color_Attributes (:CHANGES.STATUS,
                                 THIS_REC,
                                 'CHANGES.STATUS');

           NEXT_RECORD;

    END LOOP;

  END IF;

 
  First_Record;



END;


-- 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

BEGIN

       

          IF IN_STATUS = 'REQUESTED' THEN
            SET_ITEM_INSTANCE_PROPERTY(IN_COLUMN_NAME, IN_ROW_COUNT, VISUAL_ATTRIBUTE, 'RED');
          END IF;
         
          IF IN_STATUS = 'ASSOCIATED' THEN
            SET_ITEM_INSTANCE_PROPERTY(IN_COLUMN_NAME, IN_ROW_COUNT, VISUAL_ATTRIBUTE, 'YELLOW');
          END IF;

          IF IN_STATUS = 'ASSIGNED' THEN
            SET_ITEM_INSTANCE_PROPERTY(IN_COLUMN_NAME, IN_ROW_COUNT, VISUAL_ATTRIBUTE, 'GREEN');
          END IF;

         
END;

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???

Much appreciated...

Regards,

Pardeep (BT Software Engineer)
0
Comment
Question by:pardeep_nagra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
16 Comments
 

Author Comment

by:pardeep_nagra
ID: 2571294
Urgently needed answer... thanks..
0
 
LVL 3

Accepted Solution

by:
SrinivasK earned 40 total points
ID: 2573087
HI
You have to write this code in the POST-QUERY trigger of the CHANGES block.

         IF :STATUS = 'REQUESTED' THEN
            SET_ITEM_INSTANCE_PROPERTY(:CHANGE_ID,                                 CURRENT_RECORD, VISUAL_ATTRIBUTE,
              'RED');
         END IF;
                             
         IF :STATUS = 'ASSOCIATED' THEN
             SET_ITEM_INSTANCE_PROPERTY(:CHANGE_ID,                                   CURRENT_RECORD, VISUAL_ATTRIBUTE,
                 'YELLOW');
         END IF;

         IF :STATUS = 'ASSIGNED' THEN
              SET_ITEM_INSTANCE_PROPERTY(:CHANGE_ID,                                  CURRENT_RECORD, VISUAL_ATTRIBUTE,
                 'GREEN');
         END IF;

This should work coz whenever u enter the block, for each record queried post query trigger fires.
Regs,
Srinivas K
0
 

Author Comment

by:pardeep_nagra
ID: 2574960
(( Srinivask ))

I tried out what you suggested and it worked... thanks !!!

But I have one small problem, when I click on a record in the multi row block I want it to highlight a different colour... and then when I click on another record I want it to go back to it's original colour before I highlighted it...

I tried using set_item_instance procedure but it highlights every record I click on and doesn't send them to their original colour after I have clicked another one...

Basically I wanted to highlight the record I am currently selecting...

Would you know how to do this??

I tried a Pre-record trigger but I cannot workout the best way of doing this...

waiting eagerly for your reply... thanks...

Regards,

Pardeep
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 3

Expert Comment

by:SrinivasK
ID: 2576683
For this you can use the property "current record visual attribute group" for the block, if you want all items in the block to get highlighted or for the item if you want specific items to get highlighted when you are on it.

let me know whether this is ok with you.

thanks
Srinivas k
0
 

Author Comment

by:pardeep_nagra
ID: 2576858
((Srinivas K))

I tried using that property you suggested before but what happens is that when I click a record it highlights it as I want... but then when I click another record, the new record also gets highlighted which is what I want... but the previous record I clicked on should now go back to its original colour and not stay the colour of selectd records... as this functionality would turn all records to he same colour... and this is not what I want to achieve...

do you get what I mean?? I know it sounds confusing but it's not...

Basically I just want the current record selected to turn to a different colour...

Could you possibly give me some sample code to achieve this?? I'm really desparate as I have a deadline soon...

Much appreciated,

Pardeep
0
 
LVL 3

Expert Comment

by:SrinivasK
ID: 2576928
i have a question
do you have two different valus for the properties
1.visual attribute group
2.current record visual attribute group

if you have two different values for these properties, then
when you on a particular record its color will be that defined by "current record visual attribute group" and all other records will have colors defined by their  "visual attribute group " property.

just check this.Also may be u have some code previously which is causing this problem that the color of unselected records remaining with selected color.
if possible u can send ur fmb file as attachment to my mail id
onapriya@mailcity.com.

thanks,
Srinivas K
0
 

Author Comment

by:pardeep_nagra
ID: 2578575
Srinivas

I have sent you the FMB...

Regards,

Pardeep
0
 
LVL 3

Expert Comment

by:SrinivasK
ID: 2580124
i didn't get any mail at all.
regs,
Srinivas K
0
 

Author Comment

by:pardeep_nagra
ID: 2581359
Srinivas, what is your full email address... is it: onapriya@mailcity.com
           or: apriya@mailcity.com ??
0
 
LVL 3

Expert Comment

by:SrinivasK
ID: 2581376
its the first one.
r u still having problems ?
regards,
Srinivas K
0
 
LVL 3

Expert Comment

by:SrinivasK
ID: 2581527
its the first one.
r u still having problems ?
regards,
Srinivas K
0
 

Author Comment

by:pardeep_nagra
ID: 2582054
Yes I am still having probems.. I have sent u the Form.. let me know if u got it... thanks...


0
 
LVL 3

Expert Comment

by:SrinivasK
ID: 2589237
In the file you've sent, there is no visual attribute associated with the "current record visual attribute group " property of the 'CHANGES' block.
I am not able to make out where you are going wrong.
If you set the "current record visual attribute group " property of the 'CHANGES' block to some color other than the color for the property "visual attribute group " then the form should behave the way you wanted.
Just try again, it should work.
Regards,
Srinivas K
0
 
LVL 6

Expert Comment

by:crsankar
ID: 2632480
Can you please send me the fmb file. I can do this for you the way you want it.

0
 

Author Comment

by:pardeep_nagra
ID: 2633188
Hi crsankar,

I don't have ur email address... could you send me your email address?? Then I will send you the FMB file...

Thanks...
0
 

Author Comment

by:pardeep_nagra
ID: 2708498
Thank u all... you've been great !!!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle Query - Convert letters to numbers and display the difference 3 61
Oracle database T-1 Setup 7 44
plsql job on oracle 18 108
Oracle Date 6 40
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question