function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
satheesh psatheesh p 

Formula Expression is required on the action attributes when checkbox clicked

Hi All,

when i try to pass value it shows Formula Expression is required on the action attributes When checkbox clicked in UI

Visual Page

                   <apex:inputcheckbox value="{!allbranch}"> 
                        <apex:actionSupport event="onchange" action="{!selectedvalue}" reRender="out"/>
                    </apex:inputCheckbox> All Branch <br/>
                    <apex:inputcheckbox value="{!branch1}"> 
                        <apex:actionSupport event="onchange" action="{!selectedvalue}" reRender="out"/>
                    </apex:inputCheckbox> branch1<br/>


public boolean allbranch{get;set;}
 public boolean branch1{get;set;}​

public String selectedvalue(){
        String query = '';
        if(allbranch == true)
          // System.debug('Ouput Value---------------------------- allbranch'+allbranch);
           query = '';
        if(branch1== true)
           //System.debug('Ouput Value---------------------------- '+branch1);
           query = 'Branch__c = XXXX';
       System.debug('*************************************query Value ---'+query);
        return query;       
    public PageReference pageLoad() {
       city = selectedvalue();
       //System.debug('Selected city:------------------------ '+city);

Can any one try to resolve this problem.

Thank you..
SandhyaSandhya (Salesforce Developers) 

This error may occur if your redirecting user to some other page using pageReference method and if you forgot to mention forward slash. 

pageReference paq = new pageReference('apex/somecontrollername');  // you will get error 

pageReference paq = new pageReference('/apex/somecontrollername'); // this will work 
As I can see, there is a page reference method in your code.

Thanks and Regards

Hello there,

Do you find any solution? i have exact problem
George Tasker 10George Tasker 10

I know this question is from years ago, but I was having this same issue, and this page came up at the top of the search results when I was trying to determine why.  In my case I was using ActionFunction, not ActionSupport, but it may be a similar issue.

With ActionFunction, the apex method that you call must return a void or a PageReference.  It cannot return a string, or you get the error mentioned above.