You need to sign in to do that
Don't have an account?
Ralph Pence
Using IF statements in VisualForce emails
I'm trying display a field and line break only if a certain checkbox, ".Activity_Completed__c", is unchecked, otherwise I don't want it to display anything.
<apex:outputText rendered="{!IF(OR(ISBLANK, 'cx.Activity'), !NOT(cx.Activity_Completed__c)), NULL, '{!cx.Activity__c}<br/>'}" />
<apex:outputText rendered="{!IF(OR(ISBLANK, 'cx.Activity1'), !NOT(cx.Activity_Completed1__c)), NULL, '{!cx.Activity__c}<br/>'}" />
<apex:outputText rendered="{!IF(OR(ISBLANK, 'cx.Activity2'), !NOT(cx.Activity_Completed2__c)), NULL, '{!cx.Activity__c}<br/>'}" />
<apex:outputText rendered="{!IF(OR(ISBLANK, 'cx.Activity3'), !NOT(cx.Activity_Completed3__c)), NULL, '{!cx.Activity__c}<br/>'}" />
...
I'm very new to visualforce so I'm not sure if I'm going in the right direction
<apex:outputText rendered="{!IF(OR(ISBLANK, 'cx.Activity'), !NOT(cx.Activity_Completed__c)), NULL, '{!cx.Activity__c}<br/>'}" />
<apex:outputText rendered="{!IF(OR(ISBLANK, 'cx.Activity1'), !NOT(cx.Activity_Completed1__c)), NULL, '{!cx.Activity__c}<br/>'}" />
<apex:outputText rendered="{!IF(OR(ISBLANK, 'cx.Activity2'), !NOT(cx.Activity_Completed2__c)), NULL, '{!cx.Activity__c}<br/>'}" />
<apex:outputText rendered="{!IF(OR(ISBLANK, 'cx.Activity3'), !NOT(cx.Activity_Completed3__c)), NULL, '{!cx.Activity__c}<br/>'}" />
...
I'm very new to visualforce so I'm not sure if I'm going in the right direction
Your condition is not clear .
You can try like below .
Add condition in output panel and if condition will satisfy then the component inside will execute and it will give like break after the component .
Try to add your condition accordingly .
Let me know if it helps.
Thanks
Mnaoj
Boolean getEnableFeature1 () {
return String.isBlank(cx.Activity_Completed__c)
&& String.isNotBlank(cx.Activity_Completed1__c);
}
Then just code rendered="{!enableFeature1}"
Note: I can't make heads or tails of you logic so the above is just an example. You have to write the logic. But your boolean logic will be much clearer in Apex then in those expressions in VF. I try to use few if any merge functions in VF merge references. It's cleaner and easier to write and read in Apex