You need to sign in to do that
Don't have an account?
Div403
Insert Checkbox value in custom object using vf page and controller
Hi All,
I have tried so many functioanlities but am unable to insert the checkbox value in custom object
Kindly help me out of this
VF Page
<apex:page standardcontroller="TestExample__c" extensions="TestExample">
<apex:form>
<apex:selectCheckboxes title="Reinsurance Verification" value="{!test.TestPage__c}">
<apex:selectOption value="{!test3}"> </apex:selectOption>
</apex:selectCheckboxes>
<apex:outputPanel layout="block">
<apex:commandButton value="Save and Close" action="{!Save}"/>
</apex:outputPanel>
</apex:form>
</apex:page>
controller
public class TestExample{
public TestExample Test{get; set;}
public SelectOption test3 {get;set;}
public TestExample{
test3 = new SelectOption('Apex', 'Apex');
test=new TestExample__c();
}
public PageReference Save() {
TestExample__c t = new TestExample__c();
t.TestPage__c = Test.TestPage__c;
insert t;
}
}
I have tried so many functioanlities but am unable to insert the checkbox value in custom object
Kindly help me out of this
VF Page
<apex:page standardcontroller="TestExample__c" extensions="TestExample">
<apex:form>
<apex:selectCheckboxes title="Reinsurance Verification" value="{!test.TestPage__c}">
<apex:selectOption value="{!test3}"> </apex:selectOption>
</apex:selectCheckboxes>
<apex:outputPanel layout="block">
<apex:commandButton value="Save and Close" action="{!Save}"/>
</apex:outputPanel>
</apex:form>
</apex:page>
controller
public class TestExample{
public TestExample Test{get; set;}
public SelectOption test3 {get;set;}
public TestExample{
test3 = new SelectOption('Apex', 'Apex');
test=new TestExample__c();
}
public PageReference Save() {
TestExample__c t = new TestExample__c();
t.TestPage__c = Test.TestPage__c;
insert t;
}
}
Refer the below link.
http://www.infallibletechie.com/2014/08/how-to-create-checkboxes-in-visualforce.html
Thanks for response.
That links gives only visualforce page. I need controller for the vf Page.
I think you can acheive this using standard controller not neccessary to go extensions,
I think it will be helpful for you..