function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ross Gilbert 31Ross Gilbert 31 

apex:actionsupport not working within apex:repeat

Does anyone know why this won't work?

The following code works, wher eteh actionsupport attribute is outside the apex:repeat attribute.  When a user clicks the link in a VF page it updates the user's related contact record with a couple values:
 
<apex:form >
    <apex:outputLink value="https://www.salesforce.com" target="_blank" 
      id="theLink">www.salesforce.com           
            <apex:actionSupport event="onclick" action="{!setFTPClickedInfo}"    
               rerender="testOPP" immediate="true">
                  <apex:param name="clickLink1" assignTo="{!clickedURL}" value="Download"/>
             </apex:actionSupport>
    </apex:outputLink>                                              
<apex:repeat var="posid" value="{!assetIdToPosId[assetKey]}">

However when I just move that outputlink and its action support INSIDE the apex:repeat attribute...the action support functionality stops working.  This does not work:
 
<apex:form >
                                  
<apex:repeat var="posid" value="{!assetIdToPosId[assetKey]}">

    <apex:outputLink value="https://www.salesforce.com" target="_blank" 
      id="theLink">www.salesforce.com           
            <apex:actionSupport event="onclick" action="{!setFTPClickedInfo}"    
               rerender="testOPP" immediate="true">
                  <apex:param name="clickLink1" assignTo="{!clickedURL}" value="Download"/>
             </apex:actionSupport>
    </apex:outputLink>

Anyone know how to fix this?
James LoghryJames Loghry
I've had nothing but trouble getting actionSupport to work in the past.  Instead, I would move it to an actionFunction tag (outside of the repeat). In the repeated outputLink, you'd add a onclick attribute that calls the javascript / action function.

See the following SFSE post for an example of how that works: http://salesforce.stackexchange.com/questions/24175/passing-method-parameters-with-apexactionfunction
Mahesh DMahesh D
Remove the immediate="true" attribute and try.
Ross Gilbert 31Ross Gilbert 31
Thanks a lot.  I actually fixed it yesterday myself by enclosing the code in <apex:actionregion>.  I'll try your suggestion as well to see if both approaches solve the issue.  Thanks again!