1 of 1 people found this helpful
"binding" in JSF is processed on 6th phase if component is new, otherwise it's processed on 1st phase and then not re-evaluated. You should see just the same if you replace a4j:commandLink with h:commandLink. Also it would be good to see bean code.
Thanks for the reply. That does make sense. Is there any way that I can force a re-binding? As I mentioned, if I click a regular link that reloads the page, the dataTable is rebuilt, and the changed columns are there. It's only on the reRender that it doesn't do it.
I'm not able to post the code that I've developed, but it's modeled on the BalusC code here: http://balusc.blogspot.com/2006/06/using-datatables.html#PopulateDatatable. I don't bind to the panelGroup like he does, but I do bind directly to the dataTable created by his "myBean" bean. I have an actionBean that handles the commandLink click.
Would it help if I bound to the panelGroup instead?
FWIW, binding to the panelGroup didn't help ... which makes sense, too, I suppose.
try to reRender another top level component which contains that dataTable. I mean try to put datatable for example in the h:panelGroup and reRender that panelGroup istead of dataTable. Maybe that will work ok.
<rich:dataTable ... />
Thanks for the suggestion, Harut, but that change didn't fix it.
For posterity's sake, I've found the solution: Whenever the a4j request is made to my action listener bean, I have it tell the dataTable-building bean to flush its table. That bean then does a simple myDataTable.getParent().getChildren().remove(myDataTable). This page helped me figure it out: http://www.coderanch.com/t/213312/JSF/java/dynamic-datatable-binding.
View rebuilding is done when navigation happens (even if you navigate to the same view). Does common link have attached navigation case in your application?
Also view changes done by action should be reflected by AJAX re-rendering, I suggest to check if there were some issues with AJAX updates by checking contents of a4j:log for error/warning messages.
Sorry for the late reply on this. Unfortunately, I'm not able to revisit it, as I migrated the dataTable structure to the frontend, and took away the binding from the backing bean. As part of the learning process, I had started by defining my table in the xhtml mockup, then hit what I thought were some limitations that led me to try the binding. Once I understood how that was working, though, I was able to go back to the xhtml, binding only to properties, and not the whole dataTable.