You need to sign in to do that
Don't have an account?
Vivek 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
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
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,
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
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
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}'
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