Refreshing a Specific Cell in dvt:pivotTable

The following code snippet may help you to partial refresh a specific cell in dvt:pivotTable component (Thanks Chadwick Chow for this tip)
 UIPivotTable pt = getUIPivotTable();  
 CellIndex current = pt.getCellIndex();  
 try {  
      // Get desired Data Cell  
      DataCellIndex index = new DataCellIndex(2, 0);  
      // sets currency  
      pt.setCellIndex(index);  
      // ppr the cell  
      RequestContext.getCurrentInstance().addPartialTarget(pt.getCellComponent());  
 } finally {  
      // restore currency  
      pt.setCellIndex(current);  
 }  

Comments

Darshan Punjabi said…
I am using this code in bean using valuechangeevent of the cell of the pivot table. But cell data is not refreshing, its changing back to its original value in the pivot table. Can you please help?
Akshay said…
refresh your iterator cache.

DCIteratorBinding binding = RmsUIUtils.findIterator("PoDiffMatrixVOIterator");
binding.invalidateCache();

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of my employer.