You need to sign in to do that
Don't have an account?
birdofprey
Only show pageMessage and nothing else.
So what I want for my visualforce page to do, depending on two cases:
- display the application form, with no apexPage.message.
- if ApexPage.message is being call than it should only display that message and nothing else, such as the save button and tab and column headers.
Have a look at the attachment screeshot (http://i.imgur.com/gfcsJhs.jpg) and let know what you think.
This is the controller that is doing all this:
public AddLineItems(ApexPages.StandardController controller) { finID = ApexPages.currentPage().getParameters().get('CF00Ne0000000UEXy_lkid'); finForm = [SELECT Id,Name,RecordTypeId,RecordType.Name, Approval_Status__c FROM Financial_Form__c WHERE Id = :finID]; formName = finForm.Name; String recApprovalStatus = finForm.Approval_Status__c; if (recApprovalStatus.contains('Processing') || recApprovalStatus.contains('Completed')){ ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Approval is processing or completed, no new line items can be added.'); ApexPages.addmessage(myMsg); }else{ ... //assign all variables to display. } }
Hi,
You can handle that by using rendered property. Keep the <apex:pageMessages> in an output panel and use the rendered property there like rendered = "{!visible = false}.
and keep everything else within another outputPanel and rendered this panel as rendered = "{!visible = true}
In controller
public Boolean visible {get;set;}
visible = true;
within constructor.
And when page message is to be displayed then made it false..like here
If this post solves your problem kindly mark it as solution. if this post is helpful please throw Kudos.
Thanks