Is it possible to add or edit multiple records on a custom VF page? For the example below, if lineItemList return fewer than 10 records, I would like to render blank inputfields for insert of new records. The way I have it set now, it will only render as many inputfields as existing records. As always, any help is appreciated.
Page:
<apex:page standardcontroller="Resourcing_Plan__c" extensions="MultipleLineItemsController">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:outputPanel >
<apex:outputField value="{!rp.name}"/>
<apex:pageblocktable>
<apex:repeat value="{!lineItemList}" var="a">
<tr>
<td><apex:inputField value="{!a.Resource_type__c}" /></td>
<td><apex:inputField value="{!a.Weekly_commitment_fte__c}"/></td>
<td><apex:inputField value="{!a.Area_of_Expertise__c }"/></td>
</tr>
</apex:repeat>
</apex:pageblocktable>
</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller:
public with sharing class MultipleLineItemsController
{
public resourcing_plan__c rp {get;set;}
public list<Resource_plan_line_item__c> lineItemList{get;set;}
public MultipleLineItemsController(ApexPages.StandardController controller)
{
controller.addFields(New String[]{'name'});
rp= (Resourcing_Plan__c)controller.getRecord();
lineItemList=[select Resource_type__c, Weekly_commitment_fte__c,
Area_of_Expertise__c from Resource_plan_line_item__c where
Resourcing_Plan__c=:rp.id limit 10];
}
}