+ Start a Discussion

Add Row Save functionality not creating new records

I have some code I found on here to create "Add Row" functionality.  Everything seems to work except the Save button.  Its not creating the new records. 

What should happen is on a Subscription record, I have an embedded apex page to add Subscription Asset (which is a related list on the Subscritpion record).  I want to be able to add multiple rows of the Subscription Asset and save them to the related list on the current Subscription record.  What happens when I click Save, it refreshs, blanks out the fields in the embedded apex page and doesn't save any of the Subscription Asset records anywhere.  
public class MultiAdd {
public String currentRecordId {get;set;}
    //will hold the Subscription Asset records to be saved
    public List<Subscription_Assets__c>lstAsset = new List<Subscription_Assets__c>();

    //list of the inner class
    public List<innerClass> lstInner

    //will indicate the row to be deleted
    public String selectedRowIndex
    Public Support_Subscription__c ss

    Public Subscription_Assets__c sa
    //no. of rows added/records in the inner class list
    public Integer count = 1;

//save the records by adding the elements in the inner class list to lstAsset,return to the same page
public PageReference Save()
        PageReference pr = new PageReference('/apex/CW_Support_Subscription');
         // Fill in the values for the new record
    //lstAsset = new List<Subscription_Assets__c>();
  for(Subscription_Assets__c sa : lstAsset)      
        for(Integer j = 0;j<lstInner.size();j++)
           //Subscription_Assets__c sa = lstInner.asset;


        insert lstAsset;
        return pr;

    //add one more row
    public void Add()
        count = count+1;

    /*Begin addMore*/
    public void addMore()
        //call to the inner class constructor
        innerClass objInnerClass = new innerClass(count);

        //add the record to the inner class list
    }/* end addMore*/

    /* begin delete */
    public void Del()
        system.debug('selected row index---->'+selectedRowIndex);
        count = count - 1;
    }/*End del*/

    public MultiAdd(ApexPages.StandardController ctlr)
        currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
        lstInner = new List<innerClass>();
        selectedRowIndex = '0';
    }/*End Constructor*/

    /*Inner Class*/
    public class innerClass
        /*recCount acts as a index for a row. This will be helpful to identify the row to be deleted */
        public String recCount

        public Subscription_Assets__c asset

        /*Inner Class Constructor*/
        public innerClass(Integer intCount)
            recCount = String.valueOf(intCount);       
            /*create a new Asset*/
            asset = new Subscription_Assets__c();
        }/*End Inner class Constructor*/   

    }/*End inner Class*/
}/*End Class*/

Can you try using rerender attribute on your apex:commandbutton ?