Configuring List and Form Applets to display a color based on the value selected
Using the Applet Presentation Model (PM) user property you can configure a list applet column (s) or form applet control (s) to highlight a field with colors based on the value selected. You can add a CSS definition to show the column (s) or control (s) in the specified color.
For example, if the Customer Service Center wants to easily highlight customer ‘sentiment’ for Service Requests to assist Service Agents, then this is easily done. Where ‘sentiment’ is pre-defined - potentially via Oracle AI Services, then Developers can make a column in a list applet appear in a specific color (such as traffic lights) if the sentiment column has a value positive, negative, or neutral. This simple feature reduces development and configuration effort, whilst making the UX more intuitive for users.
To customize a List or Form Applets to display a color based on the value of a specific Calculated Field
-
Create a calculated field say<calc_field >, outcome of its value will work as a decision factor to display the background colour for the control.
For example,IIf(LookupName("GENAI_SENTIMENT", [ Sentiment])="POSITIVE","Positive",IIf(LookupName("GENAI_SENTIMENT", [Sentiment])="NEGATIVE","Negative",IIf(LookupName("GENAI_SENTIMENT",[Sentiment])="NEUTRAL","Neutral","")))
-
Expose the calculated field as a Business Component Private Field.
Note: If this BusComp User Prop already exists, add a comma, then your new field name, such as: <Existing Field 1>, <Existing Field 2>,Sentiment Indicator. -
Set Force Active to TRUE.
-
Configure the properties to be exposed as Presentation Model properties:
Name: ClientPMUserProp
Value: Record State Field, Record State Control, Positive, Negative, Neutral
(Positive, Negative, Neutral are the expected value of above calc field)
-
For each expected value of the expression (in this example, Positive, Negative or Neutral), add name-value pairs as applet user properties as mentioned in point b below.
-
Name: Record State field
Value: calc_field (Name should match as created in step 1)
-
Below user properties Name i.e., point i. ii, iii or so on (should match exactly the outcome of calculated field created in step 1):
-
Name: Positive
Value: siebui-positive
-
Name: Negative
Value: siebui-negative
-
Name: Neutral
Value: siebui-neutral
-
-
Name: Record State Control
Value: Sentiment (comma separated BC field name. e.g., Sentiment, Priority, Status)
Comma separated applet control (s) specified in the value of user property ‘Record State Control’, will have background colour based on the calculated field value. If calc field value = ‘Positive’, siebui-positive class name added. If calc field value = ‘Negative, siebui-negative class name added. If calc field value = ‘Neutral, siebui-neutral class name added.
-
Go to Site Map, Manifest Administration and associate the renderer to your applet for list applet.
Type | Usage Type | Name | File |
---|---|---|---|
Applet | Physical Renderer | <Applet Name> |
Name
|
Go to Site Map, Manifest Administration and associate the renderer to your applet for Form applet.
Type | Usage Type | Name | File |
---|---|---|---|
Applet | Physical Renderer | <Applet Name> |
Name
|