Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Visualforce Development
- :
- Save button not working
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Save button not working
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-14-2012 03:57 PM
I have a visualforce page setup and have inline editing setup on it. For some reason the Save button does not do anything but refreshes the page. I have just set it up to use the builtin save button. At least I think I do.
Here is the visualforce page:
<apex:page standardController="Census_Import__c" extensions="censusImportPageExtension">
<style type="text/css">
.odd{background-color: #DBDBDB;}
.even{background-color:#E4E4E4;}
</style>
<apex:form >
<apex:pageBlock title="Accounts To Import">
<apex:inlineEditSupport showOnEdit="inlineEditSave">
<apex:dataTable value="{!accts2imp}" var="a2i" width="100%" rowClasses="odd,even" cellspacing="1px" cellpadding="5px">
<apex:column value="{!a2i.First_Name__c}"><apex:facet name="header">First Name</apex:facet></apex:column>
<apex:column value="{!a2i.Last_Name__c}"><apex:facet name="header">Last Name</apex:facet></apex:column>
<apex:column value="{!a2i.Phone__c}"><apex:facet name="header">Phone</apex:facet></apex:column>
<apex:column value="{!a2i.Address_1__c}"><apex:facet name="header">"Adress Line 1</apex:facet></apex:column>
<apex:column value="{!a2i.City__c}"><apex:facet name="header">City</apex:facet></apex:column>
<apex:column value="{!a2i.State__c}"><apex:facet name="header">State</apex:facet></apex:column>
<apex:column value="{!a2i.Zip__c}"><apex:facet name="header">Zip Code</apex:facet></apex:column>
<apex:column value="{!a2i.Class__c}"><apex:facet name="header">Class</apex:facet></apex:column>
<apex:column value="{!a2i.DOB__c}"><apex:facet name="header">DOB</apex:facet></apex:column>
<apex:column value="{!a2i.Effective_Date__c}"><apex:facet name="header">Effective Date</apex:facet></apex:column>
<apex:column value="{!a2i.Gender__c}"><apex:facet name="header">Gender</apex:facet></apex:column>
<apex:column value="{!a2i.Hire_Date__c}"><apex:facet name="header">Hiredate</apex:facet></apex:column>
<apex:column ><apex:inputcheckbox value="{!a2i.Import__c}"/><apex:facet name="header">Import?</apex:facet></apex:column>
</apex:dataTable>
<apex:commandButton action="{!save}" id="inlineEditSave" value=" Save " />
</apex:inlineEditSupport>
</apex:pageBlock>
</apex:form>
</apex:page>Here is the extension:
public with sharing class censusImportPageExtension {
public censusImportPageExtension(ApexPages.StandardContro ller controller) {
}
public list<Account_To_Import__c> acctsToImport {get;set;}
public list<Account_To_Import__c> getaccts2imp(){
acctsToImport = [select Import__c, Address_1__c, Address_2__c, Area_Code__c, Census_Import__c, City__c, Class__c, DOB__c, Effective_Date__c, Extension__c, First_Name__c, Gender__c, Hire_Date__c, Job_Title__c, Last_Name__c, Location__c, Middle_Name__c, Phone__c, Relationship__c, Salary__c, SSN__c, State__c, Suffix__c, Zip__c from Account_To_Import__c where Census_Import__c = :ApexPages.currentPage().getParameters().get('id') ];
return acctsToImport;
}
}Thanks for any help.
Re: Save button not working
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-14-2012 06:15 PM
write one save function in controller
public pagereference save(){
insert accts2imp;
return (page reference for view page);// this lind will direct you to list mode. above statement is enough to insert record.in that case you remove return type
}
Hit the Kudos button (star) if any post helps you - Mark the answer as solution, It might help others running to into similar problem in future.
Re: Save button not working
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-15-2012 03:09 AM
Hi
write save method in the controller.it will add more benifites because If you save it by using satndard save function then It will redirect you to the standard detail page which is not your requirement .So its better to save method in custom controller as you are using Inlineedit. Here is some code you can refer..
public PageReference Save() {
update accts2imp;
PageReference newpage = new PageReference('/apex/YourVfpage');
newpage.setRedirect(true);
return newpage ;
}Did this post answers your questions if soplease mark it solved

