I need to control the visibility of multiple pageblocksections based on user's profile and status of the record.Currently I am using rendered attribute on pageblocksection and adding conditions like below.
AND($Profile.Name !='System Administrator',FC.Status__c!='Draft')
For each pageblocksection I need to add multiple conditions on rendered attribute.Is there any better way to control the visibility of pageblocksection based on profile and status of the record
Best Answer
I would move your logic into the controller. You have much more control this way. You can use this one property to set the visibility of many components on your page and keeps the logic in the controller layer as opposed to the view layer, which is always a best practice.
Something like this
In your VF
To learn more about the Salesforce MVC model, take a look here
http://wiki.developerforce.com/page/Visualforce:_An_Overview