I want my command button to be visible if a boolean variable "ReviewedByHCP" is set to false, and hidden if it's set to true.
Here's what I have:
<apex:form>
<apex:commandbutton id="MarkReviewBtn" rendered="{!IF(testResultObj.ReviewedByHCP == false), true,false}" styleClass="btn btnGreen" value="{!$Label.JC_CM_Mark_as_Reviewed}"
onclick="markAsReviewed()" action="{!markAsReviewed}"/>
</apex:form>
Best Answer
The reason your logic failed was that your close paren is in the wrong spot in your merge syntax. Correct
IF
syntax isIF(logical_test, value_if_true, value_if_false)
.Incorrect:
Correct:
However, even the correct syntax is excessively verbose. It demonstrates a common anti-pattern in merge syntax, namely:
The corollary here is that:
So in summary, as you noted, negation is much simpler.