Skip to content

Instantly share code, notes, and snippets.

@capeterson
Created January 18, 2012 02:26
Show Gist options
  • Save capeterson/1630454 to your computer and use it in GitHub Desktop.
Save capeterson/1630454 to your computer and use it in GitHub Desktop.
apex:repeat indexes in visualforce pages
<apex:actionFunction name="removeItem" action="{!removeItem}" rerender="theForm">
<apex:param name="rowIndex" value="" />
</apex:actionFunction>
<apex:pageBlockTable var="index" value="{!memberIndexes}">
<apex:column width="18">
<apex:image value="{!URLFOR($Resource.RemoveItem)}" title="Remove Family Member" width="16" onClick="removeItem({!index});" />
</apex:column>
<apex:repeat var="field" value="{!$ObjectType.Person__c.FieldSets.NewFamily}">
<apex:column >
<apex:facet name="header">{!field.label}</apex:facet>
<apex:inputField value="{!members[index][field]}" required="false"/>
</apex:column>
</apex:repeat>
</apex:pageBlockTable>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment