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
VINODKUMAR REDDY KALUVAVINODKUMAR REDDY KALUVA 

reRender Problem In visualforce page

I have one checkbox in an object I want to update that checkbox in visualforce page, I'm able to update that checkbox successfully using(command button) apex controller, but that problem here is I want to display the output of that checkbox field without refreshing a page, I'm trying using a reRenderattribute to that command button called Update but's not displaying the checkbox output.


User-added image
 
<apex:outputpanel id="counter" style="overflow:scroll;" layout="block">         
          <apex:actionStatus id="counterStatus" startText=" (Fetching...)" stopText=" (done)"/>

              <apex:pageBlock mode="maindetail" Id="Refre">
              <apex:panelGroup id="ref2" >
               <apex:outputPanel id="ref1" styleClass="tableContainer" layout="block" style="height:420px" rendered="{!NOT(ISBLANK(quo))}"> 

            <apex:pageBlockTable value="{!quo}" var="q" rendered="{!(quo.size!= 0) && (quo.size < 999)}"  id="tb2Quotes" styleclass="floatingHeaderTable" style="overflow:scroll;height:250px;width:100%"> 

                 **<apex:column value="{!q.Quote_Line_Item__r.Order_Received__c}" styleClass="noWrap" style="border:1px solid #D7D8D9" headerValue="Order Received"/>**
                 <apex:column value="{!q.Discount__c}" styleClass="noWrap" style="border:1px solid #D7D8D9" headerValue="Discount"/>
                 <apex:column styleClass="noWrap" style="border:1px solid #D7D8D9;height:5px;" headerValue="Quote Preview">
                 <apex:commandbutton value="Quote Preview"  onclick="return window.open('/apex/QuotePreview?id={!q.Quote_Line_Item__r.Quote1__c}')" style="font-size: 5pt; color: black"  />
                 </apex:column>
                 <apex:column styleClass="noWrap" style="border:1px solid #D7D8D9" headerValue="Open Quote">
                 <apex:commandbutton value="open Quote" onclick="return window.open('https://nicomatic.my.salesforce.com/{!q.Quote_Line_Item__r.Quote1__c}')" style="font-size: 5pt; color: black" />
                 </apex:column> 
                 *<apex:column styleClass="noWrap" style="border:1px solid #D7D8D9"  >
                 <apex:facet name="header">Priority <apex:COMMandLink style="color: green" action="{!allupdateOrderReceived}" value="header" rerender="Refre" Value="!ALL Order Receved Update" /> </apex:facet>  
                        <apex:commandButton value="Update" action="{!updateOrderReceived}"  reRender="Refre,counter">
                          <apex:param name="selected" value="{!q.Quote_Line_Item__r.Id}" assignTo="{!selected}" /> 

                       </apex:commandButton>*
              <!--   
              <apex:facet name="header">Priority <apex:commandLink style="color: green" action="{!updateOrderReceived}" value="header" Value="!Order Received Update" > 
                                 <apex:param name="Selected" 
                                    value="{!q.Quote_Line_Item__r.Id}" 
                                   /> </apex:commandLink></apex:facet>   
               <apex:inputCheckbox value="{!q.Quote_Line_Item__r.Order_Received__c}" /> -->
              <!--   <apex:inputCheckbox value="{!q.Quote_Line_Item__r.Order_Received__c}" />
                 <apex:commandbutton value="Update"  style="font-size: 5pt; color: black" /> -->
                 </apex:column>           
            </apex:pageBlockTable>          
             <apex:outputText rendered="{!(quo.size = 0)}" value="There are no records to display." />
              <apex:outputPanel rendered="{!NOT(ISBLANK(quo))}">
                 <apex:outputText rendered="{!quo.size > 999 }" value="Refine search Records should be less than 1000"  />
             </apex:outputPanel>  
              </apex:outputPanel>
              </apex:panelGroup>   

        </apex:pageBlock> 

           </apex:outputpanel>

 
Sampath SuranjiSampath Suranji
Hi,
I think there is no option available for rerender specific column in pageBlockTable. You can rerender pageBlockTable instead.
Note: rerender not working when we use "rendered" attribute in pageBlockTable.

regards
VINODKUMAR REDDY KALUVAVINODKUMAR REDDY KALUVA
@Sampath Thanks for the reply!...

reRender attribute for pageblockTable  is not there it's saying


 
Sampath SuranjiSampath Suranji
Hi,
Try below sample code,
<apex:page controller="devForum10_16">
    <apex:form >
        
        <apex:actionStatus id="counterStatus" startText=" (Fetching...)" stopText=" (done)"/>
        
        <apex:pageBlock Id="Refre">               
            
            <apex:pageBlockTable value="{!quo}" var="q"   id="tb2Quotes" styleclass="floatingHeaderTable" style="overflow:scroll;height:250px;width:100%"> 
                
                <apex:column value="{!q.name}" styleClass="noWrap" style="border:1px solid #D7D8D9" headerValue="Order Received"/>**
                
                <apex:column headerValue="Discount" id="clmDis">
                    <apex:outputPanel id="pnlDis">
                        <apex:outputField value="{!q.Discount__c}"/>
                    </apex:outputPanel>
                </apex:column>                            
                
                *<apex:column styleClass="noWrap" style="border:1px solid #D7D8D9"  >
                <apex:commandButton value="Update" action="{!updateOrderReceived}"  reRender="tb2Quotes">
                    <apex:param name="selected" value="{!q.Id}" assignTo="{!selected}" /> 
                    
                </apex:commandButton>*
                
                </apex:column>           
            </apex:pageBlockTable> 
            
        </apex:pageBlock> 
        
    </apex:form>
</apex:page>
public class devForum10_16 {
    
    public List<Quote> quo{get;set;}
    public string  selected {get;set;}
    
    public devForum10_16(){
        bindQuotes();
    }
    public void bindQuotes(){
        try{
            quo= [select id,name,Discount__c from quote];
        }
        catch(Exception ex){}        
    }
    
    public void updateOrderReceived(){
        try{
            system.debug('selected '+selected);
            if(selected!=null){
                Quote q= [select id,Discount__c from quote where id=:selected];
                q.Discount__c= !q.Discount__c;
                update q;
                bindQuotes();
            }
        }
        catch(Exception ex){}
        
        
    }
}
regards