Pages

Friday, September 23, 2011

Conditional Rendering : Usage of Rendered Attribute and Partial Trigger

In this post we will understand how to render the adf components using the refresh component.In above diagram, B is a child of component A and rendered of B is controlled based on parameter renderBParam value. An action or event from component C updates the renderBParam parameter value. So what needs to be done to show hide the component B ?

Set the partialTrigger of component B to point to id of component C and see what happpens ? Oopps nothing happened ... is partial trigger working ? ... is render attribute working ?

Lets first learn what went wrong which is not allowing it to work and then we will understand how to refresh ( show/hide ) ?

When rendered attribute is set to false for a specific component that component will not be included into the source rendered on the client and all life cycle phases will be skipped for the component in cause.
So, the partialTriggers attribute doesn’t work if set on component B because the component is not available. So refresh another component which is parent of B so that when it refreshed component B gets rendered.

Solution : Surround component B with another parent component .. in our case say A. Now set the partialTrigger of component A to point the id of component C. Whenever C triggers that action/event it refreshed the component A which in turns refresh component B.