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
ForceLoverForceLover 

pageblocktable is not refreshing

HI,

 

My VF page is not refreshing the pageblocktable while clicking the save button,i used rerender of pageblock on the button but still it's not refreshing.

 

Here is my VF code

<apex:page standardController="LeadBackup__c" sidebar="false" extensions="SiteLead" tabStyle="Lead">
 <head>
    <style>
        .startStyle{
            font-size:12px;
            font-weight:bold;
            color:red;
        }     
    </style>
 </head>
        
  <apex:sectionHeader title="Lead Form" subtitle="New Lead" />
    <apex:outputPanel id="hiddenblock">
    <apex:pagemessages />
    </apex:outputPanel>
     <apex:form id="frm">
    <div style="width:1400px; padding-left:5%; ">
     <apex:pageBlock id="Block" mode="edit">
     <apex:pageBlockButtons location="both">
        <apex:commandButton action="{!save}" value="Save Records" rerender="hiddenblock, Block" />
        <apex:commandButton action="{!cancel}" value="Cancel"/>
      </apex:pageBlockButtons>
        <apex:pageBlockSection >
         <apex:pageblockSectionItem >
      
          <apex:outputLabel for="searchText" style="font-size:14px">RefID/FileNumber</apex:outputLabel>
          <apex:panelGroup >
          <apex:inputText id="searchText" value="{!searchText}"/>
          <apex:commandButton value="Search" action="{!search}" rerender="hiddenblock, Block" status="status"/>         
          </apex:panelGroup>
         </apex:pageblockSectionItem>
         
        </apex:pageBlockSection>
        
        <apex:actionStatus id="status" startText="Searching... please wait..."/>
      <apex:pageBlockSection title="Lead Results" id="resultsBlock" columns="1">
        <apex:pageBlockTable value="{!searchResults}" var="LeadBackup__c" rendered="{!NOT(ISNULL(searchResults))}">
          <apex:column value="{!LeadBackup__c.Name}" headerValue="LeadName" width="100">
          </apex:column>
          <apex:column value="{!LeadBackup__c.Street__c}" headerValue="Street" width="100"/>
          <apex:column value="{!LeadBackup__c.City__c}" headerValue="City" width="100"/>
          <apex:column value="{!LeadBackup__c.State__c}" headerValue="State" width="100"/>
        
        <!--  <apex:column headerValue="First Name" width="100">
            <apex:inputField value="{!Lead.FirstName}"/>
          </apex:column>
          <apex:column headerValue="Last Name" width="100">
            <apex:inputField value="{!Lead.LastName}"/>
          </apex:column> -->
          
          <apex:column headerValue="Email" width="100" style="font-size:12px">
            <apex:inputField value="{!LeadBackup__c.Email__c}"/>
          </apex:column>
          <apex:column headerValue="Phone" width="100">
            <apex:inputField value="{!LeadBackup__c.Phone__c}"/>
          </apex:column>
          <apex:column headerValue="Evening Phone" width="100">
            <apex:inputField value="{!LeadBackup__c.Evening_Phone__c}"/>
          </apex:column>
          <apex:column headerValue="Preferred Call Time" width="100">
            <apex:inputField value="{!LeadBackup__c.Preferred_Call_Time__c}"/>
          </apex:column>
          <apex:column headerValue="Notes" width="100">
            <apex:inputField value="{!LeadBackup__c.Notes__c}"/>
          </apex:column>
          <apex:column headerValue="Do Not Call" width="100">
            <apex:inputField value="{!LeadBackup__c.Do_Not_Call__c}"/>
          </apex:column>
          
        </apex:pageBlockTable>
      </apex:pageBlockSection>
     </apex:pageBlock>
    </div> 
   </apex:form>
</apex:page>

 Thanks in advance.

Starz26Starz26

output the {!searchresults} right below the opening pageblock tage and see if it is actually returning anything....

 

If not, start debugging your controller. You may have errors happening that are not being displayed since the pagemessages id not inside an outputpanel and being rerendered.

Avidev9Avidev9
Just a wild guess rerender="hiddenblock, Block".

Can you remove the extra space before block ?

And have checked for errors ? I will suggest you to rerender "hiddenblock" so that errors can be displayed by Pagemessage