Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I just want to customize the font color in an IG

Joseph UpshawJan 21 2022 — edited Jan 21 2022

APEX 21
All I am trying to do (and I have been at this for hours now) is to have the font color of one column changed based on the value of another column in the same row. Sure seems simple, right?
My approach was to include a column to store the class to apply in the source SELECT (if there is some other way to do this, I am happy to change direction)

SELECT RESULT_SOURCE_ID,
       RESULT_SOURCE_SDLC_LEVEL_ID,
       RESULT_SOURCE_SERVICE_NAME,
       CONTAINS_SAT_REPOSITORY,
       CASE CONTAINS_SAT_REPOSITORY
        WHEN 'Y' THEN 'redFont'
        ELSE 'inheritFont'
       END AS FONT_CLASS    
FROM SAT_RESULT_SOURCE

Then, on the column I wanted to set the class on, CONTAINS_SAT_REPOSITORY, in Appearance, for CSS Classes, I put &FONT_CLASS. This does nothing. No class gets assigned in the DOM. If I put a static string here, e.g. MY_FAKE_CLASS, it adds that class. This is no good since I want a dynamic class here.
If you add it to Advanced for CSS Classes, even though you are on the column attributes, it adds the class to the entire control, in u-Form-inputContainer. I didn't expect this to work. I know this is the wrong place for it but, it's just interesting that, there, it at least translates the &COLUMN_NAME_HERE. and in the other place, apparently, it can not.
Any idea how to accomplish this (or to, with some other method, dynamically change font colors)?
I also thought about using A Dynamic Action to assign the classes via JavaScript (ugly) but, IG has no analog event to After Refresh that we had for IRRs so, AFIK, there's no way to trap the event when the IG gets refreshed (such a strange omission) and, hence, no where to put this code in.
Thanks,
-Joe

This post has been answered by Hamza Al-abbasi on Feb 3 2022
Jump to Answer
Comments
Post Details
Added on Jan 21 2022
11 comments
3,900 views