You need to sign in to do that
Don't have an account?
anuragsinghns
Custom Component unable to call controller method form command button
Hi ,
I have a custom component and I have a button in the component it does not call the action emthod it is supposed to when clicked.
/My component /
<apex:component controller="myCOntroller" id="theComponent" allowDML="true">
<apex:commandButton value="Cancel" action="{!cancelDomain}" reRender="DomainSection" >
</apex:component>
/my contoller method/
public void cancelDomain() {
system.debug('Test');
}
I am unable to figure out why the action method does not get called any help would be appreciated.
Below is working code:
VF Component:
<apex:component controller="myCOntroller1" id="theComponent" allowDML="true">
<apex:commandButton value="Cancel" action="{!cancelDomain}" reRender="DomainSection" />
<div id="DomainSection"> Test</div>
</apex:component>
Apex class
public class myCOntroller1{
public void cancelDomain() {
system.debug('11111111111111111Test');
}
}
VF Page
<apex:page id="thePage">
<apex:form >
<c:Test_Comp />
</apex:form>
</apex:page>
Thanks