You need to sign in to do that
Don't have an account?
khushbu
Auto refresh datatable
Hello all salesforce team,
I am new for salesforce.
I am having one issue .I want to autorefresh my datatable on any event when DML operation (insert,update,delete )occur.
I have tried actionpollar . but it wont work.
Please direct me.
Thanks
Khushbu Shah
I'm not finding any other way for that auto page refresh on DML fire.
Thanks
All Answers
Rerender the command button from which the method you called from Page for Saving the record i.e for DML operation. For e.g
<apex:outoutpanel id="datatableid">
<apex:datatable>
//Your logic
</apex:datatable>
</apex:outputpanel>
<apex:commandbutton action="{!YourMethod}" value="Save" rerender="datatableid"/>
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
Thanks a lot for reply.
Actualy , I have created object.
I have manually inserted 5 records in it.
I have created one page in that I am having one datatable .
Now what I want is :
Whenever my data is being updated , deleted or new data inserted , My grid should be refreshed.
I have tried actionPoller.
But I dont want to refresh my page on some fix period of time or on some commandButton action.
I want to autorefresh my page on DML operations on that object only.
Here is my code :
<apex:page showHeader="false" sidebar="false" standardController="employee__c" recordSetVar="employee">
<apex:pageBlock title="Customer Overview">
<apex:form id="abc" >
<apex:dataTable value="{!employee}" var="emp" id="emptable" rowClasses="odd,even"
styleClass="tableClass">
<apex:column >
<apex:facet name="header">Employee ID</apex:facet>
<apex:outputText value="{!emp.empID__c}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Employee Name</apex:facet>
<apex:outputText value="{!emp.empName__c}"/>
</apex:column>
<apex:actionPoller rerender="emptable" interval="5"/>
</apex:dataTable>
</apex:form>
</apex:pageBlock>
</apex:page>
Please help
Khushbu,
This is looking not possible in my eyes.
You can judge whether a DML occurs or not through Trigger and Workflow but you can't automatically refresh a page on the event of DML operation.
It can only be done as to refresh the page on some fix period of time through action poller.
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
But ActionPoller will call that method in every 5 0r 10 seconds to check for any DML operations..Is there any other way to do this?
I'm not finding any other way for that auto page refresh on DML fire.
Thanks
OK . Thanks a lot for your response.