You need to sign in to do that
Don't have an account?
SalesforceLearner
Dont want to render page block if particular condition is satisfied
I tried using below code but it is not working. If i use it in Vf page it is working.
Page
<apex:pageBlockSection columns="1" rendered="{!NOT(isString=true)}"> <apex:pageBlockSectionItem labelStyle="text-align: left; padding-bottom: 15px"> <apex:outputLabel value="{!$Label.Revenue}" for="tabIndex21" /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem labelStyle="text-align: left; padding-bottom: 15px"> <apex:inputField id="tabIndex21" value="{!MPE.Revenue__C}" required="true"/> </apex:pageBlockSectionItem>
<apex:pageBlockSection >
Apex:
public void emeaChanges()
{
isString = false;
if(EmpwrApp.Region_Theater__c.Contains('WEST'))
{
if((EmpwrApp.Technology_Segment_Interest__c.Contains('X'))||(EmpwrApp.Technology_Segment_Interest__c.Contains('Y'))||(EmpwrApp.Technology_Segment_Interest__c.Contains('Z')))
{
isString = true;
}
}
else
{
isString = false;
}
Page
<apex:pageBlockSection columns="1" rendered="{!NOT(isString=true)}"> <apex:pageBlockSectionItem labelStyle="text-align: left; padding-bottom: 15px"> <apex:outputLabel value="{!$Label.Revenue}" for="tabIndex21" /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem labelStyle="text-align: left; padding-bottom: 15px"> <apex:inputField id="tabIndex21" value="{!MPE.Revenue__C}" required="true"/> </apex:pageBlockSectionItem>
<apex:pageBlockSection >
Apex:
public void emeaChanges()
{
isString = false;
if(EmpwrApp.Region_Theater__c.Contains('WEST'))
{
if((EmpwrApp.Technology_Segment_Interest__c.Contains('X'))||(EmpwrApp.Technology_Segment_Interest__c.Contains('Y'))||(EmpwrApp.Technology_Segment_Interest__c.Contains('Z')))
{
isString = true;
}
}
else
{
isString = false;
}
Otherwise, you could simply specifiy rendered="{!NOT(isString)}" and it should work just fine.
Also, keep in mind that you want to render a parent element of the pageBlockSection and not the pageblocksection itself.