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

Rendered and rerender is not working inside datatable

Hi friends,
I am having an issue with inputcheckbox/commandlink when rendering.
Below is my page code.

<apex:dataTable value="{!VenueList}" var="v" rowClasses="even,odd" cellpadding="5" styleClass="table_vl" id="table_List"  rendered="{!VenueList.size > 0}">
         <!-- Action Checkbox -->
         <apex:column headerValue="REFER">
    <apex:outputPanel id="recomendationNotcreated" rendered="{!IF((v.rec==null), 'true', 'false')}">
           <apex:inputCheckbox value="{!v.isSelected}" id="referLabel" styleClass="referLabel" style="margin-left: 15px;" rendered="{!IF((v.noOfServiceProviders == 1), 'true','false')}">
            <apex:actionSupport event="onclick" action="{!createRecomendation}" rerender="headerComponent,table_List" status="RecomendingStatus">
      <apex:param name="vid" value="{!}" assignTo="{!venueRefId}"/>
                  <apex:param name="venueRefd" value="{!}" assignTo="{!venuePricingInfoRefId}"/>
                  <apex:param name="locationRefd" value="{!v.vpi.MD_Locations_Serviced__c}" assignTo="{!locationServicedRefId}"/>
     <apex:actionStatus id="RecomendingStatus">
     <apex:facet name="start">
         <!-- <div class="vd-processing">&nbsp;&nbsp;<apex:outputLabel value="Processing..." for="referLabel"/></div> -->
         <div class="loading_Text"></div>
      <div class="innerBlock_Text">
             <img  src="{!URLFOR($Resource.VenueSearch,'images/130.gif')}" width="16px" height="16px" title="Please Wait..." />
   <apex:outputPanel id="recomendationcreated" rendered="{!IF((v.rec!=null), 'true', 'false')}">
           <apex:commandLink styleClass="clearRefer Remove" value="Remove" action="{!updateRecomendation}" rerender="headerComponent,table_List" status="loadingStatus" >
                  <apex:param name="dvid" value="{!}" assignTo="{!venuePricingInfoRefId}"/>
                  <apex:param name="recommendId" value="{!v.rec.Id}" assignTo="{!recomendUpdateId}"/>
                  <apex:param name="vid" value="{!}" assignTo="{!venueRefId}"/>
              <apex:actionStatus id="loadingStatus">
               <apex:facet name="start">
               <!-- <div class="vd-place">&nbsp;&nbsp;Please wait...</div> -->
                 <div class="loading-Txt"></div>
                 <div class="innerBlocktxt">
                  <img  src="{!URLFOR($Resource.VenueSearch,'images/130.gif')}" width="16px" height="16px" title="Please Wait..." />

Here I am rendering commandlink when I click on checkbox and when I click on command link I am rendering checkbox. Here it is working only when the page get refreshed manually. I need to render those without loading the page. Please post your comments if I have made any mistake in the page...
Maros SitkoMaros Sitko
try to put our table inside apex:outputPanel with id="table_List", and remove Id from your table. From my experience, if you want rerender datatable you need rerender parent tag
Thanks Maros Sitko for your reply. I already tried rendering with outputpanel id of datatable. But either of the case the datatable/outputpanel is not rendering whenever action methods are calling... I did the same functionality for apex:repeat rendering the outputpanels of the apex:repeat, in that case its working perfectly.
Is there any alternative for this or any kind of solution to acheive this....
Maros SitkoMaros Sitko
Can you put here our method updateRecomendation?
public Pagereference  updateRecomendation() {
        List<Recommendations__c> toUpdateRcmds = new List<Recommendations__c>();
        List<Recommendations__c> recommendationsList = [Select id,Request_Sent__c,Is_Removed__c from Recommendations__c WHERE Venue_DB__c=:venueRefId AND id=:recomendUpdateId AND];
        // Segregate to Delete and Update
        if(recommendationsList!= null && !recommendationsList.isEmpty()){
            for(Recommendations__c r :recommendationsList){
                if(r.Request_Sent__c==false && r.Is_Removed__c==false){
                    Recommendations__c rcmnd = r;
                    rcmnd.Is_Removed__c = true;
               update toUpdateRcmds;
            }Catch(Exception e){
              System.debug('Error while deleteing and udating recomends'+e);
        return null;
Maros SitkoMaros Sitko
I thing that VenueList is list of your Recommendation (Recommendations__c), am I right?
When you click on 'Remove', you update Recommendation, but you do not reload data in your VenueList with updated data, so in VenueList is old value, not updated from Recommendation record.  Probably similar situation is in your createRecomendation method.
I'm facing a very similar problem here. Is this resolved, dev.shiv?