Thursday, February 29, 2024

APEX Master Detail side-by-side form ICON_CLASS and ICON_COLOR_CLASS explained

In case you are wondering what to put in the ICON_CLASS and ICON_COLOR_CLASS columns of the query underlying the left side column of a Master Detail side-by-side form, here is an example.

select "FILE_ID",
    null LINK_CLASS,
    apex_page.get_url(p_items => 'P210_FILE_ID', p_values => "FILE_ID") LINK,
    case 
      when x.ACTIVE = 'Y' then 'fa fa-badge-check' 
      else 'fa fa-low-vision' 
    end AS ICON_CLASS,
    null LINK_ATTR,
    case 
      when x.ACTIVE = 'Y' then 'u-color-4' 
      else 'u-color-15' 
    end AS ICON_COLOR_CLASS,
    case when coalesce(:P210_FILE_ID,'0') = x."FILE_ID"
      then 'is-active' 
      else ' '
    end LIST_CLASS,
    (substr("FILE_NAME", 1, 50)||( case when length("FILE_NAME") > 50 then '...' else '' end )) LIST_TITLE,
    (substr("REPORT_NAME", 1, 50)||( case when length("REPORT_NAME") > 50 then '...' else '' end )) LIST_TEXT,
    null LIST_BADGE
from "V_BATCH_REPORT_FILES" x
where (:P210_SEARCH is null
        or upper(x."FILE_NAME") like '%'||upper(:P210_SEARCH)||'%'
        or upper(x."REPORT_NAME") like '%'||upper(:P210_SEARCH)||'%'
    )
  and REPORT_ID = :P200_REPORT_ID
order by "REPORT_ID","FILE_SEQUENCE"

ICON_CLASS refers to the icons of the font awesome set therefore you must provide both the generic fa class and the specific icon class to get the desired icon to show up.

ICON_COLOR_CLASS refers to the set of colors defined by the classes u-color-dd whose actual value depends on selected theme.

The result for the report template Media Type (Show Icons and Show Descriptions in the template options) will be as follows:

 



No comments:

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles