+ Start a Discussion
DodiDodi 

VF Rerender problem

I have a VF page, my page block table is rerendering fine(table), however my Output Panel(panelWrapper) is not rerendering unless I do a full page refresh. I have tried wrapping the output panel at the pageblock level as well, and it still won't re-render properly. Any ideas would be appreciated. 

 

Thanks

 

<apex:page controller="ManifestMaintenanceController2">

<script type="text/javascript">
    function checkAll(cb,cbid)
        {
            var inputElem = document.getElementsByTagName("input");                    
            for(var i=0; i<inputElem.length; i++)
            {            
                 if(inputElem[i].id.indexOf(cbid)!=-1){                                       
                    inputElem[i].checked = cb.checked;
                }
            }
        }  
</script>

      <apex:form id="form">
            
   
          <apex:pageBlock id="block">
          
              <apex:pageBlockButtons >
                  <apex:commandButton value="Remove from Manifest" action="{!processRemoveSelected}" rerender="panelWrapper, table"/>
                   <apex:commandButton value="Return to Manifest" action="{!pageCancel}"/>
              </apex:pageBlockButtons>
                 
                  
                 <apex:outputPanel id="panelWrapper">
                 <apex:outputText style="font-style:italic" value="{0} Manifest Lines available to remove.">
                          <apex:param value="{!workOrderCount2Remove}"/>
                      </apex:outputText>
                </apex:outputPanel>
     
              <!-- In our table we are displaying the cServiceOrderLine records -->
              <apex:pageBlockTable value="{!serviceOrderLines2Remove}" var="c" id="table">
                  
                    <apex:column ><apex:facet name="header">
                      <!-- This is our selected Boolean property in our wrapper class -->
                      <apex:inputCheckbox value="{!c.selected}" onclick="checkAll(this,'checkedone')" />
                         </apex:facet>
                         
                        <apex:inputCheckbox value="{!c.selected}" id="checkedone"/></apex:column>
                 
                 
                  <!-- This is how we access the records within container/wrapper -->
                  <apex:column value="{!c.con.Name}" />
                  <apex:column value="{!c.con.SVMXC__Activity_Type__c}" />
                  <apex:column value="{!c.con.SVMXC__Line_Type__c}" />
                  <apex:column value="{!c.con.SVMXC__Line_Status__c}" />
                  <apex:column value="{!c.con.SVMXC__Received_City__c}" />
                  <apex:column value="{!c.con.SVMXC__Quantity_Shipped2__c}" />
                  <apex:column value="{!c.con.SVMXC__Service_Order__c}" />
                  <apex:column value="{!c.con.SVMXC__Work_Description__c}" />
              </apex:pageBlockTable>
        
          </apex:pageBlock>
                         
     </apex:form>
</apex:page>

Best Answer chosen by Admin (Salesforce Developers) 
DodiDodi

Ok, this issue was in my controller. I was not setting the value back to null for the param value explicitley after calling the action method. I set the value to null and it is rerendering properly now.

 

Thanks everybody for your help.

All Answers

hisalesforcehisalesforce

Hi ,

I got the similar problem.Don't know why this issue is coming.

But this can be solved.Make a new pageblocksection do all the rerender from pageblocksection.Keep the outputpanel inside pageblocksection.

Rerender is always issues with  the commandbutton and outpanel.

 

DodiDodi

Still not quite working....I added multiple pageblocksections, and tried a couple different scenarios. Below is updated code trying to get the rerender working properly. Still only updates the "table" section. Not panelWrapper or blockSection2.

 

<apex:page controller="ManifestMaintenanceController2">

<script type="text/javascript">
    function checkAll(cb,cbid)
        {
            var inputElem = document.getElementsByTagName("input");                    
            for(var i=0; i<inputElem.length; i++)
            {            
                 if(inputElem[i].id.indexOf(cbid)!=-1){                                       
                    inputElem[i].checked = cb.checked;
                }
            }
        }  
</script>

      <apex:form id="form">
          <apex:pageBlock id="block">            

               <apex:pageBlockSection id="blockSection1">  
     
                  <apex:commandButton value="Remove from Manifest" action="{!processRemoveSelected}" rerender="blockSection2, panelWrapper, table"/>
                   <apex:commandButton value="Return to Manifest" action="{!pageCancel}"/>
                </apex:pageBlockSection>
               <apex:pageBlockSection id="blockSection2">   
                 <apex:outputPanel id="panelWrapper">
                 <apex:outputText style="font-style:italic" value="{0} Manifest Lines available to remove.">
                          <apex:param value="{!workOrderCount2Remove}"/>
                      </apex:outputText>
                </apex:outputPanel>
             </apex:pageBlockSection>
     
     <apex:pageBlockSection >
              <!-- In our table we are displaying the cServiceOrderLine records -->
              <apex:pageBlockTable value="{!serviceOrderLines2Remove}" var="c" id="table">
                  
                    <apex:column ><apex:facet name="header">
                      <!-- This is our selected Boolean property in our wrapper class -->
                      <apex:inputCheckbox value="{!c.selected}" onclick="checkAll(this,'checkedone')" />
                         </apex:facet>
                         
                        <apex:inputCheckbox value="{!c.selected}" id="checkedone"/></apex:column>
                 
                 
                  <!-- This is how we access the records within container/wrapper -->
                  <apex:column value="{!c.con.Name}" />
                  <apex:column value="{!c.con.SVMXC__Activity_Type__c}" />
                  <apex:column value="{!c.con.SVMXC__Line_Type__c}" />
                  <apex:column value="{!c.con.SVMXC__Line_Status__c}" />
                  <apex:column value="{!c.con.SVMXC__Received_City__c}" />
                  <apex:column value="{!c.con.SVMXC__Quantity_Shipped2__c}" />
                  <apex:column value="{!c.con.SVMXC__Service_Order__c}" />
                  <apex:column value="{!c.con.SVMXC__Work_Description__c}" />
              </apex:pageBlockTable>
        </apex:pageBlockSection>
          </apex:pageBlock>
                         
     </apex:form>
</apex:page>

hisalesforcehisalesforce

Remover the outputpanel id from the rerender:

         <apex:commandButton value="Remove from Manifest" action="{!processRemoveSelected}" rerender="blockSection2, panelWrapper, table"/>

 

 

Delete panelwrapper and test it.

DodiDodi

Not working still : (

 

I tried with and without the output panel in the additional section I need re-renderd(the output panel text)

 

            <apex:pageBlockSection id="blockSection1">  
                  <apex:commandButton value="Remove from Manifest" action="{!processRemoveSelected}" rerender="blockSection2, table"/>
                   <apex:commandButton value="Return to Manifest" action="{!pageCancel}"/>
                </apex:pageBlockSection>
               <apex:pageBlockSection id="blockSection2">   

                 <apex:outputText style="font-style:italic" value="{0} Manifest Lines available to remove.">
                          <apex:param value="{!workOrderCount2Remove}"/>
                      </apex:outputText>
             </apex:pageBlockSection>



hisalesforcehisalesforce

Use commandlink instead of button and style it as a button.

ManjunathManjunath

Hi,

 

I believe it will not change, Since the value attribute in your outputtext is constant (value="{0} Manifest Lines available to remove.") .

 

Regards,

 

DodiDodi

Ok, this issue was in my controller. I was not setting the value back to null for the param value explicitley after calling the action method. I set the value to null and it is rerendering properly now.

 

Thanks everybody for your help.

This was selected as the best answer