You need to sign in to do that
Don't have an account?
salesforce_newbie
Should this code work?
Hi All,
I'm wondering if this code should work or am I doing something wrong. So I only want to display a section header if there is text in the section.
<apex:outputPanel id="output1" rendered="{ISNULL(!Position.Values__c)}">
<apex:outputLabel value="Values Statement"></apex:outputLabel></h4></apex:outputPanel> <br/><br/> <apex:outputText value="{!Position.Values__c}" id="thevaluessection"/><br/>
I have an object, Position, and it has several different field. This object is used to display info on a webpage so when the salesforce user doesn't fill in the 'Values' field, I don't want that section to appear on the webpage.
Thanks in advance.
Your outputpanel has rendered="{isnull{!Position.Values__c)}". This is not formatted right; I think you meant rendered="{isnull{!Position.Values__c)}". But this won't work either, because if Position.Values__c is null, then ISNULL(Position.Values__c) evaluates to TRUE. Therefore rendered will only equal TRUE if there is nothing in Position.Values__c.
I think you want the opposite of that. Try rendered = "{!!ISNULL(Position.Values)}". The first ! is equivalent to NOT(). Therefore your outputpanel will only be rendered if Position.Values__c is NOT NULL.
Let me know if this doesn't solve the problem.
Jeremy
All Answers
Your outputpanel has rendered="{isnull{!Position.Values__c)}". This is not formatted right; I think you meant rendered="{isnull{!Position.Values__c)}". But this won't work either, because if Position.Values__c is null, then ISNULL(Position.Values__c) evaluates to TRUE. Therefore rendered will only equal TRUE if there is nothing in Position.Values__c.
I think you want the opposite of that. Try rendered = "{!!ISNULL(Position.Values)}". The first ! is equivalent to NOT(). Therefore your outputpanel will only be rendered if Position.Values__c is NOT NULL.
Let me know if this doesn't solve the problem.
Jeremy
Thanks Jeremy that works great!
When I used it in the sandbox it worked perfectly but when I tried it in the live version, it's not working.
Do you know why this might be happening?
Thanks
Sorry ignore that..it was my silly mistake.
Thanks again for your help :smileyvery-happy:
Maybe if you post some more details. What controller is this page using? If it's custom, please post that code as well as more of the page itself.
Thanks,
Jeremy
<apex:outputtext rendered="{ISNULL(!pos)}">
Is this the correct way to render th output text?
here pos is a List.
So I am trying to to display this text incase if this List evaluates to null.
Please help