You need to sign in to do that
Don't have an account?
dev.shiv1.3478599680068948E12
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="{!v.VenueDB.id}" assignTo="{!venueRefId}"/>
<apex:param name="venueRefd" value="{!v.vpi.id}" assignTo="{!venuePricingInfoRefId}"/>
<apex:param name="locationRefd" value="{!v.vpi.MD_Locations_Serviced__c}" assignTo="{!locationServicedRefId}"/>
</apex:actionSupport>
</apex:inputCheckbox>
</apex:outputPanel>
<apex:actionStatus id="RecomendingStatus">
<apex:facet name="start">
<!-- <div class="vd-processing"> <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..." />
</div>
</apex:facet>
</apex:actionStatus>
<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="{!v.vpi.id}" assignTo="{!venuePricingInfoRefId}"/>
<apex:param name="recommendId" value="{!v.rec.Id}" assignTo="{!recomendUpdateId}"/>
<apex:param name="vid" value="{!v.VenueDB.id}" assignTo="{!venueRefId}"/>
</apex:commandLink>
</apex:outputPanel>
<apex:actionStatus id="loadingStatus">
<apex:facet name="start">
<!-- <div class="vd-place"> 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..." />
</div>
</apex:facet>
</apex:actionStatus>
</apex:column>
</apex:datatable>
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...
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="{!v.VenueDB.id}" assignTo="{!venueRefId}"/>
<apex:param name="venueRefd" value="{!v.vpi.id}" assignTo="{!venuePricingInfoRefId}"/>
<apex:param name="locationRefd" value="{!v.vpi.MD_Locations_Serviced__c}" assignTo="{!locationServicedRefId}"/>
</apex:actionSupport>
</apex:inputCheckbox>
</apex:outputPanel>
<apex:actionStatus id="RecomendingStatus">
<apex:facet name="start">
<!-- <div class="vd-processing"> <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..." />
</div>
</apex:facet>
</apex:actionStatus>
<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="{!v.vpi.id}" assignTo="{!venuePricingInfoRefId}"/>
<apex:param name="recommendId" value="{!v.rec.Id}" assignTo="{!recomendUpdateId}"/>
<apex:param name="vid" value="{!v.VenueDB.id}" assignTo="{!venueRefId}"/>
</apex:commandLink>
</apex:outputPanel>
<apex:actionStatus id="loadingStatus">
<apex:facet name="start">
<!-- <div class="vd-place"> 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..." />
</div>
</apex:facet>
</apex:actionStatus>
</apex:column>
</apex:datatable>
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...
Is there any alternative for this or any kind of solution to acheive this....
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 Opportunity__c=:opp.id];
// 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;
toUpdateRcmds.add(rcmnd);
}
}
try{
update toUpdateRcmds;
}Catch(Exception e){
System.debug('Error while deleteing and udating recomends'+e);
}
}
return null;
}
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.