+ Start a Discussion

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:selectCheckboxes title="Reinsurance Verification" value="{!test.TestPage__c}">
             <apex:selectOption value="{!test3}"> </apex:selectOption>
<apex:outputPanel layout="block">
    <apex:commandButton value="Save and Close"   action="{!Save}"/>                           


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;
Hi Anoop,

Thanks for response.
That links gives only visualforce page. I need controller for the vf Page.
Vijay NagarathinamVijay Nagarathinam

I think you can acheive this using standard controller not neccessary to go extensions,
<apex:page standardController="test__c">
<apex:form >
<apex:pageblock >
<apex:pageblocksection >
<apex:inputField value="{!test__c.name}"/>
<apex:inputField value="{!test__c.Interested_to_Relocation__c}"/>
<apex:commandButton value="Save" action="{!save}"/>

I think it will be helpful for you..