I have checkboxes on my vf page
<apex:inputCheckbox id="checkboxShowP" value="{!P}" onchange="show(this);"/>
In the controller class
public boolean P{get;set;}
I want to bind this checkbox value to a boolean variable. But when I display the P
value of apex class it is showing up as null
. Is it possible to bind variable values in this way?
Best Answer
Looks like you have not initialised the value for "P". Initialise the value in the constructor.
Do check the Apex and VF trailhead for an understanding of dynamic bindings.
Custom Controllers : https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_custom.htm