0

Rerender is not working in Vf page. I'm inline updating the list of account record, when I click on update Button then I've to refresh the only PageBlock Table and not the whole page. But PageBlock table in not refreshing.

My Code::-

<apex:page controller="RerenderExampleContro">
<apex:form >
 <apex:pageBlock id="test">  
     <apex:pageBlockSection title="Assessments" id="Assessments" columns="1" collapsible="true" >
         <apex:commandButton action="{!updateAss}" value="Update Account" style="float:right;" reRender="RefTable"/>

         <apex:outputPanel Id="blockrefresh">
         <apex:pageBlockTable value="{!Account}" var="a"  id="RefTable">
         <apex:inlineEditSupport event="ondblclick" />

            <apex:column headerValue="Description Sort" style="width:250px">
                <apex:outputField value="{!a.Name}" />
            </apex:column>

            <apex:column headerValue="Last Screening">
                 <apex:outputField value="{!a.Rating}" style="width: 85px;"/>
            </apex:column>

            <apex:column headerValue="Update">
                <apex:outputField value="{!a.type}" style="width: 115px;"/>
            </apex:column>

           </apex:pageBlockTable> 
           </apex:outputPanel>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>

Controller:

 public with sharing class RerenderExampleContro {
 public list<Account> acc;
  public List<Account> getAccount() {
    acc = [select id, name, phone,Rating,type,Industry from Account limit 5];
    return acc;
  }

public PageReference updateAss() {
update acc;
    return null;
}

 }
  • try re rendering <apex:pageBlock id="test" >, Like This reRender="test"/> – Nachiket Deshpande Nov 6 '17 at 11:49
  • @NachiketDeshpande that also tried, not wokring – Amol Nov 6 '17 at 12:08
  • Please share your controller as well. There could be some issue with your controller's Account. – Mahmood Nov 6 '17 at 14:42
  • @Mahmood I've update Question with my simple demo controller. – Amol Nov 6 '17 at 14:44
0

Your example is working fine as-is in my dev org. Only correction I made is, I changed

</apex:pageblock>

to

</apex:pageBlock>

in my code.

  • I've change to </apex:pageBlock>. but its not working. strange – Amol Nov 6 '17 at 15:01
0

You rerender should be

reRender="test,Assessments,blockrefresh,RefTable"
  • Tried, not working – Amol Nov 6 '17 at 14:50
  • I mean rerender not reRender – sfdcFanBoy Nov 7 '17 at 7:11

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.