[SalesForce] Rendered condition in visualforce

I Have Script :

<apex:pageblocksectionItem >
                <apex:outputLabel value="All Employee" />
                <apex:inputCheckbox id="ProcessAll" value="{!isAllEmployee}" selected="true">                        
                </apex:inputCheckbox>
            </apex:pageblocksectionItem> 

            <apex:panelGroup id="listEmployee">
                <c:MultiselectPicklist leftLabel="Available Employee" leftOptions="{!availableEmployee}" 
                                        rightLabel="Selected Employee" rightOptions="{!selectedEmployee}" 
                                        rendered="{!IF(!selectedPackage <> null && !selectedPayrollName <> null && !isAllEmployee <> true, true, false)}" size="14" width="475px"/>
            </apex:panelGroup>

For the first time,
I think salesforce load all object in visualforce.
But, I dont do that. I want my multiselectpiclist load only if "ProcessAll" in input check box set to "false", !selectedPackage != null and !selectedPayrollName != null.

and I get error on my code before i save the code.
"Incorrect parameter type for function 'not()'. Expected Boolean, received Text"

So, Can you help me for the fix my code?
Thank u… 🙂

Best Answer

Looks like you have a few extra exclamations/bangs (!) in your markup there.

In Visualforce, when you start using merge field syntax, it requires a bang. You don't need to always put a bang before referencing a field. Anything after the first bang acts as a logical NOT, which is where I think you're running into problems.

Your current markup, IF(!selectedPackage <> null... is equivalent to IF(NOT(selectedPackage) <> null....

NOT() and ! only work on boolean fields, and it appears that selectedPackage is a text field rather than a boolean/checbox.

Instead of checking for nulls manually, I'd probably recommend using ISBLANK().

This should work:

rendered="{!IF(!ISBLANK(selectedPackage) && !ISBLANK(selectedPayrollName) && !isAllEmployee, true, false)}"