X

It's All About the Platform.

Working With Lists of Values and Tables in Expression Language

Richard Bingham
Senior Development Manager

The following article gives some useful hints-and-tips we've used recently in helping people customizing tables and lists-of-values using Page Composer. 

Working With Tables

Let's look at a few simple rules to be aware of before considering how to customize your tables:

  1. The Simplified UI allows you to set just a few key properties, usually the Value and if the component is shown. Sometimes this is not even available, offering just a checkbox to show/hide the child components.
  2. The Desktop UI (in Design Mode) exposes more nodes of the ADF page artifact hierarchy, allowing you to customize the way the containers around the tables row display. This includes node such as Column, panelGroupLayout and panelStretchLayout.
  3. The outputText node is used for the actual values in a table. It commonly offers Short Description, Value, Show Component properties, along with formatting properties under the Style tab.
  4. Not all tables are the same, some are plain, some are rows inside a list container and some contain expandable regions. Because of this variety the properties available for customization also vary by page, resulting in different options possibly for different pages. As such for every table on every page that you wish to customize you should first check the components used and the properties available.

The following three screenshots illustrate this variety, showing the Benefits table in the Desktop UI and the resulting node hierarchy available, followed by the same in the Simplified UI with the properties exposed for customization..

The equivalent in the Simplified UI is... in essence ... simplified, exposing a smaller percentage of table components and their properties.

Accessing Values

As in the screenshots above, you'll most commonly need to use outputText node to get the rows Value property for use in
your logic, such as "row.Amount". You may notice that some table columns
have outputText nodes but others do not. In this case they're usually a
hidden child and you need to enable a parent component, such as the panelGroupLayout in the second screenshot above.

Column Driven Expressions

 

A key principle to be aware of is that all Page Composer expressions used against a table component must be written against one or more specific Columns, since the rows of data are populated at run-time (via View Object queries) and therefore cannot be part of a run-time customization. As such when writing EL be aware that it will apply to EVERY ROW in the table and special care should be taken when setting properties like Show Component.

As mentioned already, it is recommended to test your EL against the column node and also any related container nodes to ensure you get the desired behavior. The following video shows an example of a table with its rows in a panelStretchLayout component and therefore needs the expression setting at this level rather than on the column node.

Validating Child Rows

We've seen requirements for a rule to always have at least one child record, often displayed as a table on the page. An example might be to have at least one address for a company. Because you cannot interrogate the data (rows) in the underlying objects/tables using EL, this is not possible. To understand this revisit the purpose of Page Composer, to tailor the pages and fields by adjusting the properties of their components. As such data validation rules are beyond its scope.

Hyperlinked Rows

Some tables allow a drill-down into the line records, with the
values hyper-linked. Where this already exists, it can be tailored by adding a conditional expression to the commandLink node of the column in the ADF hierarchy.

This would be done by setting it Disabled property to something like the following:

#{((securityContext.userName == "RICHARD.BINGHAM" && row.bindings.Amount  > "100") || 
(securityContext.userName == "PETER.MANOHARAN" && (row.bindings.Amount  > "200)))
 ? false : true} 

Conditional Formatting

You can also use expressions inside the Style tab in page composer, adding simple logic to set the emphasis of your table rows. For example the following might be set on a column using the Other CSS property to highlight the colour of one particular job role in a list.

#{row.JobName eq "Director of Payroll" ? 'color:#0000FF' :'color:#000000'};
This is also demonstrated in this short video from our YouTube channel.
 

 

 

Lists Of Values

 

There are several different kind of lists-of-values in ADF, including pop-ups and multi-select lists, however here we will briefly look at the selectOneChoice list as it's the most commonly used across Fusion Applications pages.

Setting The Default Value

A common question is "can I change the default value in the list of values on a page"? The answer here is "not with Page Composer", since this component does not have a default property, and because the values in the final LOV are populated at run-time (based on what is in the look-up in the database) and therefore presupposing one on the page is not practical. Of course if you have a on-premises environment, then you can edit either the related View Object or extend the backing bean to set the default value programmatically.

It should be noted that many products and features have configurations and profile options that do allow you to set default values for some important fields, therefore also check the functional implementation guides.

Getting The Current Value

selectOneChoice components hold the value they will submit back to the server in the inputValue node. It should be noted that this is always an index value, representing a foreign key link to the related lookup. Since you cannot access these lookups you may consider creating logic which implies which index value is associated with which display value.Obviously this is not really recommended, and thankfully there is a little known solution. Select One Lists also have a attributeValue property which you can access to get the displayed value for your list of values. The following video illustrates this.

 

 

Join the discussion

Comments ( 2 )
  • Bethany Monday, January 8, 2018
    I want to be able to default a value from a list of values based on another field in the UI. Is that possible?

    For example, if a PO < $100, it should default the Match Approval Level to 2 Way.
  • Richard Friday, January 12, 2018
    Hi Bethany
    No you cannot use Expression Language to set the default for LOV values. These components are data-bound and do not expose a default/selected property that you can attach an expression to.
    Where a common functional requirement exists, I've seen this kind of thing implemented using product functional setups (commonly Profile Options), so I'd recommend checking/logging an Enhancement Request with product support for the specific LOV that could have default value logic associated with it.
    Kind regards
    Richard
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha