I have a typical form with <apex:repeat>
for some fields. The <apex:inputText>
elements have an onChange
attribute that references a script that then calls an <apex:actionFunction>
, for example:
Repeat Fields:
<apex:repeat value="{!myList}" var="i">
<apex:outputPanel id="rowOfMyList" styleClass="row field-row" layout="block">
<apex:inputText id="inputId" value="{!i.obj.value}" html-data-index="{!i.obj.index}" html-data-render="{!$Component.rowOfMyList}" onChange="updateField(this)"/>
</apex:outputPanel>
</apex:repeat>
JS Script:
function updateField(row) {
myActionFunction(row.getAttribute('data-index'), row.value, row.getAttribute('data-render'));
}
Action Function:
<apex:actionFunction action="{!pageRefMethod}" name="myActionFunction" rerender="{!renderRow}" >
<apex:param name="index" value=""/>
<apex:param name="goal" value=""/>
<apex:param name="render" assignTo="{!renderRow}" value=""/>
</apex:actionFunction>
When I debug my controller I get exactly what I would expect, the dynamic Id selector that salesforce puts on my managed <apex:outputPanel>
. I even then take that debug and run a search on the html source code and get an exact match on the element I expected to rerender. Unfortunately it does not rerender.
If I concatenate another ID from outside of the repeat tag to my html-data-render
attribute it too gets passed through to my rerender="{!renderRow}"
and it does rerender
Any thoughts on this would be awesome!
<apex:actionRegion>
. And right now each row is saving as needed just fine, but having issues with rendering. If I rerender the whole container then everything appears fine but this is a bad UX, because if I tab from one input to the next as I fill it in the entire container would rerender and lose its positioning.Angular
orReact
. Also, if I can pass the rerender the exact$Component.Id
I don't understand why that wouldn't work