I have a requirement in which when select the checkbox based on the value of checkbox i.e. true or false, I have to pass the value to Apex class method and based on the value of checkbox it should display an status images. I have modified the code in VF page like this:
j$('.voCheckbox').click(function() {
j$('[id$=":selectedVerifiableOutcomeIdInput"]').val(j$(this).data("output"));
j$('[id$=":currentStageInput"]').val(j$(this).data("stage"));
completeActionJSCheck();
});
<apex:actionFunction action="{!completeActionCheck}" name="completeActionJSCheck" >
<apex:param name="v" value="" assignTo="{!myCheckbox}" />
</apex:actionFunction>
VF code for setting the image based on the value of checkbox:
<label class="outcome-name">{!output.Name}:</label>
<apex:outputPanel layout="none" rendered="{!currentOpportunity[output.FieldName__c] == true}">
<input type="checkbox" class="voCheckbox" Checked="Checked" Value="true" event="onselect" style="vertical-align: middle" data-outcome="{!outcome.Id}" enable="true"/>
<i class=" green"></i>
</apex:outputPanel>
<apex:outputPanel layout="none" rendered="{!currentOpportunity[output.FieldName__c] == false}">
<input type="checkbox" Checked="False" class="voCheckbox" event="onselect" style="vertical-align: middle" data-outcome="{!outcome.Id}" enable="true"/>
<i class="fa fa-times red"></i>
</apex:outputPanel>
</apex:outputPanel>
in the above code I have used to pass the value to the Boolean variable myCheckbox. But on UI when I select/disselect the checkbox then it thows and error. "Value not of required type".
in Apex class I have modified the below code :
public boolean myCheckbox {get; set;}
ActionResult result = ActionFactory.getInstance(selectedOutputId, oppId).execute(myCheckbox);
checkActionResult(result);
Can somebody help me what I am missing here? My target is i