You need to sign in to do that
Don't have an account?

I'd like to render a pageBlock only when there is an error.
I really want to display a pageBlock only when ApexPages.hasErrors() is true.
At this stage, I can only think of putting a hasErrors boolean in my controller extension and accessing the property with
<apex:pageBlock rendered="[!hasErrors}"> but can I access the ApexPages.hasErrors directly from VisualForce?
Am I overlooking something really obvious?
Hi,
This is sample code for workround on visibility of pageblock.
VF CODE:
<apex:pageBlock rendered="{!Propset}"/>
controller code:
you can check getter and setter property in controller
Public boolean Propset{get;set;}
public void dummy()
{
if(ApexPages.haserrors())
{
Propset = true;
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
In the end I just did this.
Seems concise and to the point.