0

My Vf Page is

<apex:page standardController="Temporary_contact__c" extensions="tempView" >
 <apex:form >
     <apex:pageblock >    
       <Apex:pageblockButtons >
         <apex:commandButton value="Save" action="{!savetemp}"/>
       </Apex:pageblockButtons>  
 <apex:pageblocktable value="{!convalues}" var="con" columns="9">        
            <apex:column headerValue="Sno:">
               {!con.viewContact__c}
             </apex:column>
             <apex:column headerValue="Order Number">
                <apex:outputtext value="{!con.OrderNumber__c}" />
             </apex:column>
             <apex:column headerValue="First Name">
                 <apex:outputfield value="{!con.First_Name__c}"/>
             </apex:column>
       </apex:pageblocktable>    
      </apex:pageblock>
 </apex:form> 
</apex:page>

My class is

public class tempView {
list<Temporary_contact__c> conValues;
public list<Temporary_contact__c> getconValues() {
     conValues = [select id,First_Name__c,Last_Name__c,Email__c,Installment__c,Check_temp__c,Map_Contact__c,OrderNumber__c,Recurring__c from Temporary_contact__c];
        system.debug('connn'+conValues.size());
       for(integer i=0;i<conValues.size();i++){
            conValues[i].viewContact__c = string.valueOf(i);
        } 
        return conValues;
}
 public tempView(ApexPages.StandardController controller) {
}
  public void savetemp(){
        system.debug('1111111');// It never shows in debug log   
        //some code here
    }
}

My Problem here is when I click on save button ,it never calls the debug method.Hope someone is aware of this issue Help pls!!!!

1

Try this

<apex:commandButton value="Save" action="{!savetemp}" immediate="true"/>
public PageReference savetemp(){
        system.debug('1111111');// It never shows in debug log   
        //some code here
         return null;
    }
2
  • immediate="true" can you explain me when should I add this? – Eagerin Sf Mar 18 '13 at 7:44
  • A Boolean value that specifies whether the action associated with this component should happen immediately, without processing any validation rules associated with the fields on the page. If set to true, the action happens immediately and validation rules are skipped. If not specified, this value defaults to false. salesforce.com/us/developer/docs/pages/Content/… – Shimshon Korits Mar 18 '13 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.