[SalesForce] actionFunction reRender not working

I have the following Visualforce page and I'm trying to reRender the output panels when the actionFunction is executed, but the reRender is not working. I have tried wrapping with another outputPanel, using commandLink, etc., but nothing has worked. Anyone see why the reRender is not working?

<apex:page controller="InnovationProfileController">
<apex:form id="theForm">
<h2>My Ideas</h2>
    <apex:actionFunction action="{!deleteInnovation}" name="DeleteInnovation" reRender="userInnovationList" >   
        <apex:param name="innovationId" value="" assignTo="{!innovationToDelete}"/>
    </apex:actionFunction> 
    <apex:outputPanel id="userInnovationList">
        <apex:pageBlock id="asdf">            
        <apex:pageBlockTable value="{!userInnovations}" var="results" id="userInnovationsRepeat">
            <apex:column >
                <a href="{!IF(results.innovation.status != 'DRAFT','InnovationDetail','InnovationReview')}?id={!results.innovation.innovationId}">{!results.innovation.title}</a>  
            </apex:column>
            <apex:column >
                <a href="javascript:if (window.confirm('Are you sure you want to delete this record?')) DeleteInnovation('{!results.innovation.innovationId}');">Delete</a>
            </apex:column>                
        </apex:pageBlockTable>
        </apex:pageBlock>  
    </apex:outputPanel>

    </apex:form>

Thanks.

Best Answer

I think the problem may be with your javascript.

Putting the javascript in the href attribute of an anchor tag is going to evaluate that as part of navigation. Once your javascript executes, the default behavior is to refresh the page. More here on javascript with links https://stackoverflow.com/questions/245868/what-is-the-difference-between-the-different-methods-of-putting-javascript-code

Try changing your links to href="javascript:void(0);" and moving the javascript you have now to an onClick attribute, or change them so they are not actually links.

Related Topic