The blog for hints & tips about Oracle Application Development Framework and Mobile Application Framework

Accessing View Object UI hints from EL

Frank Nimphius
Master Principal Product Manager

View Objects can have UI hints defined in their General category. For example, you may want to set the Display Name, Display Name (Plural) and Description on Employees View Object that is based on an Employees entity representing the Employees table in the HR database sample schema. The page snippet below shows how you can access the UI hints on a View Object to display them a header information on an page. 

<af:panelGroupLayout id="pgl2"
<af:outputText value="#{bindings.allEmployeesIterator.hints['label']},"
<af:spacer width="10"
height="10" id="s1"/>
<af:outputText value="#{bindings.allEmployeesIterator.hints['labelPlural']},
" id="ot2"/>
<af:spacer width="10"
height="10" id="s2"/>
<af:outputText value="#{bindings.allEmployeesIterator.hints['TOOLTIP']}
" id="ot1"/>


So the Display Name property maps to UI hints
"label", the Display Name (Plural) property to the UI hints
"labelPlural" and the Description property to the "TOOLTIP"

These strings are defined in the oracle.jbo.AttributeHints class. For
future-save programming you should consider reading the UI hint strings directly
from this class.

To do so, expose the AttributeHints class to EL through a helper managed
bean (put it to application scope
for best performance) that exposes JavaBean properties for each of the strings.

Using such a helper bean, the above page snippets would
look similar to this

id="pgl2" layout="horizontal">
<af:outputText value="#{bindings.allEmployeesIterator.hints[helperBean.label]},"
<af:spacer width="10"
height="10" id="s1"/>
<af:outputText value="#{bindings.allEmployeesIterator.hints[helperBean.labelPlural]},
<af:spacer width="10"
height="10" id="s2"/>

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.