|
I had also the problem, that the
datascroller did not work anymore: I solved this with by using always the
same ids for the links and not the pagenr as id suffix. Here are some tips: DataScroller: I created my own DataScroller with
corresponding Tag and Renderer. All those classes extend the corresponding HtmlDataScrollers
from MyFaces. It is important that encodeChildren does
nothing and you have to call scroller.getChildren().clear() in encodeEnd(). Otherwise links could be rendered two times. I could fix the problem with the not
working links by creating dummy links for all pages in renderPaginator Something like this: //create dummy links
until maxPages is reached. These links should not be encoded! //Otherwise the links
are not executed after if (idCounter<maxPages) { for
(;idCounter<maxPages;idCounter++) {
if (scroller.getAjaxified())
{
// create an AJAX Link
this.getAjaxLink(facesContext, scroller, idCounter, idCounter);
}
else {
this.getLink(facesContext, scroller, idCounter, idCounter);
} } } Note that these dummy links should not be
encoded ! Then I patched the getLink methods: It is important that the links keep the
same ids after MyFaces used the pagenr as id suffix for
the links and this does not work! You have to use something like a linknr which
starts always at 1 and runs til maxPaginatorPages. DataTable - use a value binding for the first
attribute of the datatable and manage this property in your backing bean. e.g.
set it to 0 if you sort the table - overwrite or extend org.apache.myfaces.component.html.ext.HtmlDataTable public void setFirst(int first) { ValueBinding vb = getValueBinding("first"); if (vb != null) { //vb.setValue(getFacesContext(),
first); return; } else if (_preservedDataModel != null) {
//Also change
the currently restored DataModel attribute
_preservedDataModel.setFirst(first); } super.setFirst(first);
} The above two points are important to get
the right page visible in the datatable for scrolling or sorting after
datamodel updates. Hope this helps, Michael From: Aneesha Govil
[mailto:[EMAIL PROTECTED] Hi Michael, On 11/1/06, Michael
Heinen < [EMAIL PROTECTED]>
wrote: Annesha, I use the datatable with datascroller and a4j. I spent a lot of time to get this running and I had to patch
the datatable and the datascroller. What is your specific problem ? (I don't have the beginning of this thread) Michael From: Aneesha Govil [mailto:[EMAIL PROTECTED]] Hi Craig, On
10/31/06, Craig McClanahan < [EMAIL PROTECTED]>
wrote: On
10/31/06, Aneesha Govil <[EMAIL PROTECTED]>
wrote: Hi,
|
- RE: JSF and ajax using phaselistener approach Michael Heinen
- Re: JSF and ajax using phaselistener approach Jeff Bischoff
- Re: JSF and ajax using phaselistener approach Matthias Wessendorf
- Re: JSF and ajax using phaselistener appr... Jeff Bischoff
- Re: JSF and ajax using phaselistener ... Matthias Wessendorf
- Re: JSF and ajax using phaselist... Jeff Bischoff
- Re: JSF and ajax using phase... Matthias Wessendorf
- Re: JSF and ajax using p... Jeff Bischoff
- Re: JSF and ajax using phaselistener approach Craig McClanahan
- Re: JSF and ajax using phaselistener approach Aneesha Govil
- Re: JSF and ajax using phaselistener approach Craig McClanahan

