I Have Script :

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

            <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"/>

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... :)

  • !selectedPackage itself returns NOT, ie !selectedPackage != null means 'selectedPackage == null' – Santanu Boral Nov 18 '16 at 17:18

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)}"

Try changing you code like this:

rendered="{!IF(selectedPackage != null && selectedPayrollName != null && isAllEmployee <> true)}"

understading is, MultiselectPicklist will render if selectedPackage is not null and selectedPayrollName is not null and isAllEmployee is false.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.