public Account acc{get;set;} public testComponent(ApexPages.StandardController controller) { acc=[select id,AccountSource,check__c from account where id='0019000000CJ6QZ']; } public pagereference changeCheckBox(){ acc.check__c=true; return null; }
public Account acc{get;set;} public testComponent(ApexPages.StandardController controller) { acc=[select id,AccountSource,check__c from account where id='0019000000CJ6QZ']; } public pagereference changeCheckBox(){ acc.check__c=true; return null; }
Hi Anii,
here you go
<apex:page id="thepage" standardController="Account" extensions="testComponent">
<apex:form >
<apex:inputField value="{!acc.AccountSource}">
<apex:actionSupport event="onchange" action="{!changeCheckBox}" rerender="pan" status="counterStatus" />
</apex:inputField>
<apex:outputPanel id="pan">
<apex:inputField id="test" value="{!acc.check__c}"/>
</apex:outputPanel>
<apex:actionStatus id="counterStatus" startText=" (incrementing...)" stopText=" (done)"/>
</apex:form>
</apex:page>
public with sharing class testComponent {
public testComponent() {
}
public Account acc{get;set;}
public testComponent(ApexPages.StandardController controller) {
acc=[select id,AccountSource,check__c from account where id='0019000000CJ6QZ'];
}
public pagereference changeCheckBox(){
acc.check__c=true;
return null;
}
}
All Answers
Hi Anii
you can do by using Workflow rule just update the check box field true when condition is true
if my solution worked for you mark it as resolved.
Cheers
Hi Anni
You can write Action Support just call a method in that write true for that Checkbox and reRender.
Hi can u send me sample code
for this
Hi Anii,
here you go
<apex:page id="thepage" standardController="Account" extensions="testComponent">
<apex:form >
<apex:inputField value="{!acc.AccountSource}">
<apex:actionSupport event="onchange" action="{!changeCheckBox}" rerender="pan" status="counterStatus" />
</apex:inputField>
<apex:outputPanel id="pan">
<apex:inputField id="test" value="{!acc.check__c}"/>
</apex:outputPanel>
<apex:actionStatus id="counterStatus" startText=" (incrementing...)" stopText=" (done)"/>
</apex:form>
</apex:page>
public with sharing class testComponent {
public testComponent() {
}
public Account acc{get;set;}
public testComponent(ApexPages.StandardController controller) {
acc=[select id,AccountSource,check__c from account where id='0019000000CJ6QZ'];
}
public pagereference changeCheckBox(){
acc.check__c=true;
return null;
}
}
please mark it as solved if above works for you