You need to sign in to do that
Don't have an account?
satheesh 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/>
Apex
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..
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/>
Apex
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..
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
Thanks and Regards
Sandhya
Do you find any solution? i have exact problem
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.