2

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.

2

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.

  • I tried moving the javascript the onclick event and setting the href attribute to href="javascript:void(0);". Still no luck? – Dman100 May 28 '15 at 18:44
  • I finally figured out the issue after looking at for several hours. I wasn't getting the latest data. I was just reRendering the sections with the old data set. – Dman100 May 28 '15 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.