You need to sign in to do that
Don't have an account?
passing parameters from VF to controller
can somebody give me an example for passing boolean value from jquery in a visual force page to controller using param and action function.I'm getting this error after executing the following code...
Error: conversionTrialController Compile Error: Illegal assignment from String to Boolean at line 393 column 9
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"/>
<script type="text/javascript">
var j$ = jQuery.noConflict();
j$(document).ready(function(){
});
function orgChkBoxesSelected()
{
var orgName=j$('#chk_org_name').is(":checked");
alert(orgName);
var orgAddr=j$('#chk_org_addr').is(":checked");
getorgCheckedBox(orgName,orgAddr)
}
<apex:actionFunction name="getorgCheckedBox" action="{!getCheckedOrgBoxes}" reRender="orgBlock">
<Apex:param name="orgNames" value=""/>
<Apex:param name="orgAddrs" value="" />
<Apex:actionFunction/>
public void getCheckedOrgBoxes()
{
Boolean org_Name=Apexpages.currentPage().getParameters().get('orgNames');----------->>>>line 393 column 9
Boolean org_Addr=Apexpages.currentPage().getParameters().get(‘orgAddrs’);
organization=leadUtility.getorganization(org_Name,org_Addr);
return NULL;
}
You could check if the String returns 'True' or 'False', then assign corresponsing value to Boolean variable.
Like done below:
Or other way would be:
All Answers
Use a string variable to collect the param's as their datatype is String.
Try modifying your code as below:
You could check if the String returns 'True' or 'False', then assign corresponsing value to Boolean variable.
Like done below:
Or other way would be: