function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vetriselvan ManoharanVetriselvan Manoharan 

component rendering

I have a Header component inside which another component named FeedHeader is rendered. My problem is FeedHeader component should not render on load. It should get rendered on button click. Any ideas how to do it?
Abhishek BansalAbhishek Bansal
Hi ,

Follow the below steps :
  1. Create a boolean property in your controller class like "showHeader".
  2. Set it to false in constructor.
  3. Use renedered = "{!showHeader}" in component which you want to hide on page load
  4. On click of your button set this showHeader as true.
  5. Use rerender attribute on your button and pass the id of the component which you want to show after click. Like : rerender="headerId"
  6. Now you will be able to see the section after click of button.
Please let me know if you need more help on this.

Thanks,
Abhishek
Vetriselvan ManoharanVetriselvan Manoharan
I have two pages with that component 1 <apex:outputPanel rendered="{!renderDialog}"> <c:FeedHeader /> </apex:outputPanel> right now the renderDialog value is set as false in constructor. So the component should not render right? But it calls the component. How to avoid invoking the component on page load?
Abhishek BansalAbhishek Bansal
Hi,

I tried the same in my ORG by creating a dummy component and page.
The component is not rendering when boolean is set to false.
So there might be something which you are missing.
Please cross check your code once again and if the issue still exists than please share your complete VF page and class code.

Thanks,
Abhishek