I have a fairly simple Visualforce page which repeats a component and contains an action function called from within the component:
<apex:form>
<apex:actionFunction action="{!updateListItems}" name="updateListItems"
rerender="fileList">
<apex:param name="files" assignTo="{!files}" value=""/>
</apex:actionFunction>
</apex:form>
<apex:pageBlock id="fileListBlock">
<apex:repeat value="{!docsForUpload}" var="portalDoc">
<c:MassUpload objId="{!portalDoc.Id}" objName="{!portalDoc.Name}"/>
<script>
callUpdateListItems = files => {
updateListItems(files);
}
</script>
</apex:repeat>
</apex:pageBlock>
The component contains a table which renders the data passed in via objId
:
<apex:pageBlockTable value="{!docList}" var="record" id="fileList" rowClasses="odd,even" cellPadding="4" border="0" styleClass="dataTable">
<apex:column >
<apex:facet name="header"/>
<apex:variable var="fTitle"
value="{!IF(BEGINS(record.Id, '00P'), record['Name'], record['ContentDocument.Title']
+ '.' + record['ContentDocument.FileExtension'])}"/>
<apex:variable var="fId"
value="{!IF(BEGINS(record.Id, '00P'), 'Id', 'ContentDocument.LatestPublishedVersionId')}"/>
<apex:variable var="fDesc"
value="{!IF(BEGINS(record.Id, '00P'), record['Description'], record['ContentDocument.Description'])}"/>
<input type="hidden" class="docInput" name="selected" value="{!record[fId]}" fname="{!fTitle}"
fdesc="{!fDesc}"/>
</apex:column>
</apex:pageBlockTable>
I need to rerender just the table, and not the entire component, upon execution of the action function called from the component. I've tried various syntaxes for referencing the fileList
ID, but with no luck. I suspect that the repeater is causing problems. What's the secret?
<apex:component>
markup. Is that better referred to as a Visualforce component?