-
1. Re: dynamic dataTable, ajax4jsf, and reRendering
nbelaevski Mar 10, 2010 8:39 PM (in response to rseely)1 of 1 people found this helpfulHi Robert,
"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.
-
2. Re: dynamic dataTable, ajax4jsf, and reRendering
rseely Mar 11, 2010 8:09 AM (in response to nbelaevski)Hi Nick,
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?
Robert
-
3. Re: dynamic dataTable, ajax4jsf, and reRendering
rseely Mar 11, 2010 8:24 AM (in response to rseely)FWIW, binding to the panelGroup didn't help ... which makes sense, too, I suppose. -
4. Re: dynamic dataTable, ajax4jsf, and reRendering
harut Mar 11, 2010 8:37 AM (in response to rseely)Hi,
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.
<h:panelGroup id="ddd">
<rich:dataTable ... />
</h:panelGroup>
-
5. Re: dynamic dataTable, ajax4jsf, and reRendering
rseely Mar 11, 2010 9:03 AM (in response to harut)Thanks for the suggestion, Harut, but that change didn't fix it. -
6. Re: dynamic dataTable, ajax4jsf, and reRendering
rseely Mar 11, 2010 1:13 PM (in response to rseely)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. -
7. Re: dynamic dataTable, ajax4jsf, and reRendering
nbelaevski Mar 11, 2010 1:49 PM (in response to rseely)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.
-
8. Re: dynamic dataTable, ajax4jsf, and reRendering
rseely Mar 31, 2010 10:24 AM (in response to nbelaevski)Hi Nick,
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.
All best,
Robert