i write a small snippet related to apex:inputCheckBox

<apex:inputCheckbox onclick="callRemoteFunction(this,{!num})" selected="{!isItemSelected}"/>

i am facing error

 Unknown function isItemSelected. Check spelling

in my custom controller there is a function named isItemSelected here is definition

public Boolean isItemSelected(){
    System.debug('---coming here---');
    return false;

can anyone please explain why i am facing this issue when there is a corresponding function in controller ??

2 Answers 2


You need to change your method to:

public Boolean getIsItemSelected(){
    System.debug('---coming here---');
    return false;

Methods that can be accessed in Visualforce need to be defined as getters:

One of the primary tasks for a Visualforce controller class is to give developers a way of displaying database and other computed values in page markup. Methods that enable this type of functionality are called getter methods, and are typically named getIdentifier, where Identifier is the name for the records or primitive values returned by the method.


Visualforce actually binds to properties normally exposed like this:

public Boolean isItemSelected { get; set; }

but can also bind to methods (with names prefixed with get or set) but for where read and write access is needed as it is in this case that ends up being quite verbose:

private Boolean isItemSelected;
public Boolean getIsItemSelected() {
    return isItemSelected;
public void setIsItemSelected(Boolean value) {
    isItemSelected = value;

Its worth getting used to using the first form. See Apex Properties for more information.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .