Time for action – adding an EL expression
Add the
af:switcher
component to the page from the Component palette.Select the
switcher
component in the page from the Structure window or from thedesign
view.From the Structure window right-click on the
af:switcher
component and then select Insert into the option to insert a facet.Provide the
facet
name asfirst
. Repeat the same step to add another facet namedsecond
.In the property inspector, provide the value as
first
for thedefaultFacet
property.Inside the first facet, add the employee information from the Data Controls palette. Drag-and-drop the
EmpVO
information on to the first facet.Add the
DeptVO
to the second facet. Surround the table with a group layout or a stretch layout based on the requirements of the page.Now add the following EL expression to the
facetName
property of the switcher:#{bindings. EmpVO1.estimatedRowCount > 0 ? 'first' : 'second'}
What just happened?
The previous expression will render the first
facet if there is...