function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jack MichudaJack Michuda 

Save error in editable table

Hello all,
I'm trying to create a page that has an editable table. My code is below:
<apex:page standardController="account">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:variable var="sr" value="{!0}"/>
            <apex:pageBlockTable value="{!account.contacts}" var="contact" rows="8">
                <apex:column headerValue="Membership Number"><apex:variable var="sr" value="{!sr + 1}"/>
                  {!sr}
                   </apex:column>  
                <apex:column headerValue="Reserved"><apex:inputCheckbox /></apex:column>
                <apex:column headerValue="Shared"><apex:inputCheckbox /></apex:column>
                <apex:column headerValue="Nights & Weekends"><apex:inputCheckbox /></apex:column>
                <apex:column headerValue="Small Office"><apex:inputCheckbox /></apex:column>
                <apex:column headerValue="Large Office"><apex:inputCheckbox /></apex:column>
                <apex:column headerValue="Membership Fee"><apex:inputText /></apex:column> %make this automatically update based on click of inputCheckbox
                <apex:column headerValue="Start Date"><apex:inputText /></apex:column>
                <apex:column headerValue="End Date"><apex:inputText /></apex:column>
                <apex:column headerValue="Comments"><apex:inputText /></apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

The table itself renders how I want it to, displaying like so:
User-added image

.  For some reason, whenever I click the "Save" button, an error occurs where the page does not save or update, and subsequent attempts create an inception-like view, where the actual webpage renders itself within the grid window.

This is obviously not what I want to do, as I'm actually just trying to create a pageBlockTable that can be edited and saved. Any suggestions on how to modify my code to accomplish this?
SonamSonam (Salesforce Developers) 
save action in the standard controller works on a single record:(https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_std_actions.htm) therefore you will have to use a custom controller as explained in the blog oon the link below:
http://bobbuzzard.blogspot.sg/2011/07/managing-list-of-new-records-in.html
 
ADITYA PRAKASH 5ADITYA PRAKASH 5
You should use the "Custom Controller" in place of standarad controller for this. As a save functionality for a standrad controller only works for unit record i.e single records not for mutiple records.
shambhvi dixitshambhvi dixit
your requirment is not clear plese tell in detail what you want insert record or update