Wednesday, May 25, 2011

ADF: Faces BIDI EL


At some point, you may have an inlineStyle whose value is BIDI sensitive; in LTR (left-to-right) mode, you may want a “left” style but in RTL (right-to-left) mode, you may want a “right” style.  You don’t have to write a managed bean to give you the corresponding style, you can use EL (expression language).
Here’s an example assigning a padding for the “start” side of 10px:
inlineStyle="padding-#{adfFacesContext.rightToLeft?'right':'left'}:10px;"


See oracle.adf.view.rich.context.AdfFacesContext for other properties.