Search Results


Thursday, March 12, 2015

ADF EL expressions reference

ADF EL expressions


Security:

Checking if the user has the role assigned
#{securityContext.userInRole['ORDERS-EDIT-ROLE']}


Styling:

Conditionally setting in-line styles.
Eg: Changing background of the tree table rows based on a condition.

#{node.level ==1 ? 'background-color:#FFAD52' :  ( node.level == 2 ?  'background-color:#3173C4;color:white;' : 'background-color:#A5C6FF;'  )  }



Text Values:

EL expressions used along with text values
text="Score Card: (#{bindings.ScoreValue.inputValue})"


Passing Arguments in EL expression

Eg: this function get differrent values for outputtext based on the passed input values.

value="#{backingBeanScope.BackingBean.getDateLabel(pageFlowScope.pbb.startDate,pageFlowScope.pbb.endDate)}"

public String getDateLabel(Object from, Object to) {
        if (from == null && to != null) {
            return "TO:";
        } else if (from != null && to == null) {
            return "FROM:";
        }
        return null;
    }



No comments :