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

Rendering a pageblocksection with if statement causing an error
Don't know quite what's up with this. Seems like it should be simple. Here's the relevant code:
<apex:pageBlockSection rendered="{!IF(Opp.Utility__c = "CA-SDGE","true","false")}" title="Login ..." id="Login"> <apex:pageBlockSectionItem > <bUsername:</b> <apex:inputText value="{!username}" label="Username" required="true"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem /> <apex:pageBlockSectionItem > <b>Password:</b> <apex:inputSecret value="{!password}" label="Password" required="true"/> </apex:pageBlockSectionItem> </apex:pageBlockSection>
If I remove the rendered statement the page works fine. With the statement, I get the following error:
"The element type "apex:pageBlockSection" must be terminated by the matching end-tag "</apex:pageBlockSection>""
I have the matching end tag, and the same rendered statement is working to render a button on the page.
Any ideas why this isn't working?
The problem is the use of quoted strings inside a quoted string. Use single quotes for inner strings.
All Answers
Hi,
just replace below formula in pageBlockSection -
rendered="{!IF(Opp.Utility__c = 'CA-SDGE',true,false)}"
Hope it would help u.
The problem is the use of quoted strings inside a quoted string. Use single quotes for inner strings.
Ahh!! That worked. Thanks!!