Arron writes in to ask, "If I have ADF bindings for ADF Business Components view object row values like Returned and Total, of type oracle.jbo.domain.Number, how can I use an EL expression to calculate a percentage related one to the other?".
The answer involves accessing the input value of the bindings (which will be the "raw" attribute value of type oracle.jbo.domain.Number, and then the "value" property of the Number object that will return the value as a double. In EL, the expression would look like this:
<c:out value="${(bindings.Returned.inputValue.value / bindings.Total.inputValue.value) * 100}"/>
If you are doing this inside a <c:forEach> loop over your range binding's dataset, then you don't need the extra inputValue property in the EL expression. It would look like this:
<c:forEach var="Row" items="${bindings.EmpView.rangeSet}"> : <c:out value="${(Row.Returned.value / Row.Total.value) * 100}"/>
2:02:58 PM
|