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

Simple APEX IF Statement - What's wrong with this?
Hey there,
I'm trying to display a print button IF there is certain information in the URL string, e.g., an ?id= field. Here's my statement:
rendered="{!IF({!id} != 'null', true, false)}
Clearly, it didn't like this... any suggestions to fix? Thanks!
--Dave
p.s. here's the entire element:
<apex:outputLink rendered="{!IF(id != 'null', true, false)}" target="_blank" value="/apex/CTN_Lessons_37p?apprenticeshipId={!apprenticeshipID}&ctContactId={!ctContactId}&id={!id}">Print My Lesson</apex:outputLink>
p.s. also trying...
{!IF({!$CurrentPage.parameters.id}
e.g.,
rendered="{!IF(($CurrentPage.Parameters.id != 'null'), false, true)}"
All,
This seems to work -- any way to improve it?
<apex:outputLink rendered="{!IF(($CurrentPage.parameters.id != ''), true, false)}" target="_blank" value="/apex/CTN_Lessons_37p?apprenticeshipId={!apprenticeshipID}&ctContactId={!ctContactId}&id={!id}">Print My Lesson</apex:outputLink>
I'd try ternary operator:
Just use the comparison.