Thursday, May 19, 2011

af:switcher component sample App

Adf Switcher component will work similar to switch statement in java. The af:switcher component have two properties facet-name and default-facet. The facet will render depends upon the facet current facet name. If there is no facet name , default facet will get render.

1. In the example take department and locations. Just departments table in the page as a form inside the af:switcher component.

2. In the facetName property bind a property in the managed bean, and assign the default facet name in that propery say ‘dept’.


3. Then give the default facet name in the switcher component

4. Add a facet and drag drop the locations instance from the datacontrol.


5. Now add a action component which is going to change the facet name depends upon that the facet will get render.

Add a property listener to the command button action, then give the name for that like this


you can download the source code here.