[SalesForce] reRender not being called, yet controller is executing

I'm stuck on a reRender issue.

I have a commandButton element which calls an action function, which should reRender a pageBlock on return and then trigger an oncomplete event.

Action button in pageBlock:

<apex:pageBlock mode="detail" id="group_block">
    <!-- other code -->
    <apex:commandButton id="apply_button" value="Apply Filters" action="{!applyFilters}"  reRender="group_block" oncomplete="setup();" />
</apex:pageBlock>

public PageReference applyFilters() {
    buildDataStructures(total, DELETE_DEALERS_WITH_NO_PACKAGES);

    return null;
}

If I remove the reRender attribute then I get the functionality that I want (data structures rebuilt in the controller according to certain filters, the pageBlock is rebuilt on page refresh, and the setup() javascript function runs onready). However, I would muh prefer to only refresh the pageBlock on reRender rather than refresh the whole page.

I had this working yeaterday but I changed some (mainly markup!) code and for some reson this is no longer functioning.

I can confirm that the action function in the controller is being called, yet there is a line in the debug logs that shows:

VF_APEX_CALL|apply_button|{!applyFilters}|PageReference: none

I'm not 100% sure what this means, but I would expect it to show null there rather than none. Is this significant?

I'm not sure how I can debug this. I'm not getting any javascript errors showing in the console. I just need to find out when the controller isn't returning.

I have also tried wrapping the pageBlock in an outputPanel.

Grateful for any suggestions. Thanks

Best Answer

Depending on what you have in your <!-- other code --> section, you might be sending some other value at the same time, preventing your request to be done completely. This might be a validation rule issue or something else (if you have a validation rule preventing a DML request). They do not always show up on the UI (especially if you don't have an <apex:pageMessages/> block to display them.

Make sure you dig in your debug console, or try removing some of your other code until you find what is breaking your call. If you share some of your code, it might be easier to troubleshoot.

Related Topic