-
1. Re: rich:datascroller is jumping between selected page on pa
orribl Oct 4, 2007 11:39 AM (in response to mkuehle)Have a similar Problem with the same configuration, see http://jboss.com/index.html?module=bb&op=viewtopic&t=120099.
Did you find a solution? -
2. Re: rich:datascroller is jumping between selected page on pa
mkuehle Oct 4, 2007 3:39 PM (in response to mkuehle)It seems that with tomcat 6 and jsf ri 1.2 this behaviour doesn't occur.
Really freaking...
But unfortunately i need it with tomcat 5 and jsf 1.1 :( -
3. Re: rich:datascroller is jumping between selected page on pa
orribl Oct 4, 2007 4:40 PM (in response to mkuehle)For me its working with richfaces 3.0.1....
-
4. Re: rich:datascroller is jumping between selected page on pa
amitev Oct 5, 2007 12:25 AM (in response to mkuehle)There is a workaround for this using tomahawk's t:buffer. You buffer the dataTable and put it after the scroller. Here is a sample http://www.irian.at/myfaces/buffer.jsf
-
5. Re: rich:datascroller is jumping between selected page on pa
mkuehle Oct 5, 2007 4:14 AM (in response to mkuehle)This workaround sadly doesn't work for this special problem :(. I think this is a bug in RichFaces 3.1.0.
I deployed a new example on webthreads - first page explained (only rich:datascroller and rich:table) above and second one with t:buffer.
First example - plain richfaces components: http://webthreads.de/DataScrollerTest/datascrollerBug.jsf
Second with tomahawk t:buffer: http://webthreads.de/DataScrollerTest/tomahawkTest.jsf
You can also download the war with source files in it: http://webthreads.de/DataScrollerTest.war
The old link to war and url written in first post arn't available anymore. -
6. Re: rich:datascroller is jumping between selected page on pa
mkuehle Oct 5, 2007 4:53 AM (in response to mkuehle)Next try was with latest available RichFaces 3.0.1 and there is exactly the same behaviour: selecting randomly pages and after refreshing page with F5 one random selected page is selected and not the first one.
The big problem is that this random selected page will be also viewed if i load another jsf page and come back. So not only on refreshing this page - also when coming back from an other page this strange behaviour is coming up.
Maybe it is a general bug in datascroller component? -
7. Re: rich:datascroller is jumping between selected page on pa
orribl Oct 5, 2007 5:12 AM (in response to mkuehle)Hi Nec,
which version of Richfaces are you using exactly? I tried the latest official release (http://download.jboss.com/jboss-richfaces/jboss-richfaces-3.0.1-bin.zip and it worked for me... -
8. Re: rich:datascroller is jumping between selected page on pa
mkuehle Oct 5, 2007 5:41 AM (in response to mkuehle)Hi,
i tried exactly the same as you.
I took the same sources as used in the downloadable war file, removed richfaces3.1 jars and added ajax4jsf and richfaces 3.01. jars. And changed the namespace in xhtml pages, of course. -
9. Re: rich:datascroller is jumping between selected page on pa
mkuehle Oct 5, 2007 7:13 AM (in response to mkuehle)Maybe this behaviour has nothing to do directly with the datascroller component.
I debugged the datascroller and HtmlDataTable classes and sometime in the public void restoreState(FacesContext context, Object state) method the value "_first" is set to an old value which was set some requests before.
For example if i select first page 3 and than page 5. The first browser page reload (-F5) creates the datalist and datascroller with the first row 0 because it can't restore a state. (returns null from object array).
The second browser page reload restores the attribute _first to the last selected datascroller page or randomly to one further.
I can't explain this restoring behaviour - does someone else knows something about it? -
10. Re: rich:datascroller is jumping between selected page on pa
ilya_shaikovsky Oct 5, 2007 8:33 AM (in response to mkuehle)JSF 1.1 has some problems with state restoring as far as I remember.. :/ JSF 1.1_2 RI solves some of them but not all. Seems it something about JSF 1.1
-
11. Re: rich:datascroller is jumping between selected page on pa
mkuehle Oct 5, 2007 3:27 PM (in response to mkuehle)Next post =)
I tested it with the latest available SUN RI 1.1_02 JSF and SUN 1.2 RI implementation and with this one the behaviour is a bit clearer to understand, i think. With Sun RI the datascroller jumps always (or most times) back to first page but in backend he knows the latest ajax state.
Try this on the new online example with JSF 1.1 RI: Initial loading of sample page. Klick to one page - e.g. page 5. After selected page 5 is viewed reload your browser window with F5 - the selected page should be the initial one: page 1 as expected.
As next select the previous or next button on datascroller component and you will see that the next selected page is either the next to page 5 (next button -> page 6) or the previous (previous button -> page 4).
I think, this is because with the next ajax request the last component state, stored on last ajax request, will be restored (which was page 5 on last ajax request).
Maybe the problem is that ajax4jsf viewhandler doesn't know or doesn't react right (e.g. reset the latest ajax component state) if a normal request comes in.
Online example Sun RI 1.1: http://www.webthreads.de/DatascrollerTestJsfRi/datascrollerBug.jsf
You can also download the war (includes source files) and try it yourself local.
http://www.webthreads.de/DatascrollerTestJsfRi.war -
12. Re: rich:datascroller is jumping between selected page on pa
michaelgsearles Oct 9, 2007 4:25 PM (in response to mkuehle)Hi All,
Test environment:
MyFaces 1.1.4
RichFaces 3.1.0
JDK: 1.5
Server: Tomcat 5.0.28
I am having a very similar problem as described, but with one exception, I am not using Richfaces datascroller, instead, I am using the datascroller component from Tomahawk.
Once I drop the Richfaces 3.1.0 Jars into my project, it breaks my Tomahawk Datascroller component - the random jumping problem between pages when selecting the forward or back buttons.
Interestingly it does not happen with RichFaces 3.0.1
Mike. -
13. Re: rich:datascroller is jumping between selected page on pa
bfayle Oct 10, 2007 5:51 AM (in response to mkuehle)You can workaround this issue by creating an integer property on your backing bean and adding code in a restore view phase listener that restores the value in the datascroller component by calling the setPage() method. (Note - you need to cast your integer to string - see UIDataScroller)
You will also need a scrollListener method that updates the integer property on your backing bean with the getPageIndex() value from the datascroller.
There is still a very nasty bug with the dataScroller where it does not properly process the update model phase which prevents it from being used on editable datatables or forms where there are editable fields that should be re-rendered with different model values after a scroll event.
I hope the RichFaces guys take notice and fix this - it's really quite nasty. -
14. Re: rich:datascroller is jumping between selected page on pa
louisthelizard Nov 5, 2007 8:39 PM (in response to mkuehle)Here's what I did for a workaround:
1) add an action listener to the dataSroller:
<rich:datascroller align="center" for="prList" maxPages="20" actionListener="#{Bean.scrollAction}"/>
2) Bind the datatable:
<rich:dataTable width="300" id="prList" rows="12" columnClasses="col" value="#{Bean.requests}" var="tableData"
binding="#{Bean.table}">
3) In the Bean class:
private UIDataTable table;
private static final int last=17;
private static final int length=12;
private int page=0;
.....
public UIDataTable getTable() { return table; }
public void setTable(UIDataTable table) { this.table = table; }
public void scrollAction(ActionEvent event) {
DataScrollerEvent dse = (DataScrollerEvent) event;
String action = dse.getNewScrolVal();
if ("first".equals(action)) {
page=0;
} else if ("last".equals(action)) {
page=last-1;
} else if ("fastrewind".equals(action)) {
page--;
} else if ("fastforward".equals(action)) {
page++;
} else {
page = Integer.parseInt(action)-1;
}
}
public List getTableData() {
if (table != null) {
table.setFirst(page*length);
}
return tableData;
}