function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vivek ManchandaVivek Manchanda 

"Incorrect parameter for function IF()." why I am getting this Error?

I have made a page where I have 4 check boxs which contain  some  product  name  .  I also  have a button when ever any one select any product from all the check box and click on next  button the name of that product used to tranfer on another page .
This is the way I am getting the value in the Check box.
<apex:dataTable value="{!firstpage}" var="classesCert" id="classCert">
<apex:column>
<apex:facet name="header">Product </apex:facet>
<apex:inputCheckbox value="{!classesCert.isSelected}" selected="{!classesCert.isSelected}" id="isSelected"/>
<strong><apex:outputText value="{!classesCert.Product.Name}"/></strong>
<apex:outputText value="{!classesCert.Product.description}"/>
</apex:column>
</apex:dataTable>

On the next page I am only getting the value of the check box which I have selected .
I am getting this value through
<apex:dataTable value="{!firstpage }" var="classesCert" id="classCert" >
                               <apex:column rendered='{!IF(classesCert.IsSelected,true,false)}'>
                                       <strong><apex:outputText value="{!classesCert.Product.Name}"/></strong>
                              </apex:column>
                </apex:dataTable>
Now the problem is I have made a edit button on another page when ever I click on that edit button i get a Visual Force Error

"Incorrect parameter for function IF(). Expected Boolean, received Object "

I am getting this Error due to " <apex:column rendered='{!IF(classesCert.IsSelected,true,false)}'> " this if condition but I don't know why . Can any one tell me some other way to get the selected check box value from one page to another page .
OR
How to solve this Problem/Error.

Thanks
Vivek Manchanda
dchasmandchasman
Vivek,

Can you please post the source code for your isSelected getters and setters? There is a known issue with boolean properties returning Null giving this error and there are a couple of workarounds depending on your implementation.

Thanks,
Vivek ManchandaVivek Manchanda
Thanks For Reply

But I have solve the Problem it was very easy ..

I have just put that IF condition in the outputtext and it work .


Rest Thanks For ur Help

Thanks
Vivek Manchanda
TehNrdTehNrd

dchasman wrote:
Vivek,

There is a known issue with boolean properties returning Null giving this error and there are a couple of workarounds depending on your implementation.

Thanks,



I experienced this the other day and I thought I was going crazy? I had (since removed as I kept getting errors) an outputPanel where the rendered attribute was a getter method that returned a boolean. Sometimes it would work, sometimes it wouldn't.

What were the work arounds? Do you need some code snippets?

EDIT: I just tried this again and could not replicate the error. Any chance it was fixed?


Message Edited by TehNrd on 03-12-2008 11:39 AM
aballardaballard

Not sure why one needs the IF at all in this example.

rendered='{!IF(classesCert.IsSelected,true,false)}'

would seem like a more complicated way of expressing

rendered='{!classesCert.isSelected}'

 

Vivek ManchandaVivek Manchanda
Hi All


I need IF condition bcoz I only want to get though value's who's check box has ben selected by the user . So for that I need the IF condition .

Otherwise if any one want to see all the check box value then he or she  has no need to write if condition .

Thanks

Vivek Manchanda

dchasmandchasman
The workaround is to push the expression into a property getter in a custom controller or extension.