You need to sign in to do that
Don't have an account?
Mentee
rerender output panel to display the update list
I have a page that iterates a list object to display the records. Once clicked on save, I updated the same list with new values and debug logs shows the update list but output panel is not rerender'ed and I dont see updated list on VF page.
Controller Method :
and moreover when I add reRender = "idPanel" my apex messages are not displayed. I have no clue why :( any inputs please?
<apex:outputLabel >A </apex:outputLabel> <apex:inputfield id="idAText" value="{!ttlookup.A}" /> <apex:inputCheckbox id="checkBoxTMId" value="{!Acheckbox}"/> <apex:outputLabel > Check if you want to clear all values </apex:outputLabel> <apex:commandButton id="btnSave" value=" Save " action="{!Save}" reRender="idPanel" /> <apex:outputPanel ID = "idPanel"> <div class="container"> <table> <thead> <tr> <th>Name</th> <th>Type</th> </tr> </thead> <tbody> <apex:repeat value="{!ryList}" var="tt"> <tr> <td>{!tt.name}</td> <td>{!tt.Type__c}</td> </tr> </apex:repeat> </tbody> </table>
Controller Method :
public void save(){ Boolean noUpdateFlag = false; for(MyObjec ttry: ryList){ if(ttlookup.A !=null){ noUpdateFlag = true; ttry.name = ttlookup.A; } if(Acheckbox){ noUpdateFlag = true; ttry.name = null; } } system.debug(ryList[0].B + ' noUpdateFlag '+noUpdateFlag); try{ if(noUpdateFlag){ update ryList; ApexPages.addmessage(new Apexpages.message(apexpages.severity.CONFIRM, 'records are saved.')); } else ApexPages.addmessage(new Apexpages.message(apexpages.severity.Info, 'no value entered ')); }catch(Exception ex){ System.debug(ex); ApexPages.addmessage(new Apexpages.message(apexpages.severity.Error, 'Something went wrong')); } }
and moreover when I add reRender = "idPanel" my apex messages are not displayed. I have no clue why :( any inputs please?
Add <apex:actionstatus> which will refresh the data on actions like in this case button click
I need to query to update the list. that is the error.