You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by janw <ja...@gmx.de> on 2006/10/06 11:29:55 UTC

Datascroller displays incorrect pageIndex (1)

Hello,

I use the dataScroller bound to a backing Bean in session scope.
The table is as well bound to the backing bean.

  private UIData table;
  private HtmlDataScroller dataScroller;

Scenario:
The user scrolls to page 3, goes to a completely other page, then returns to
the page with the datatable (not by back button, but by a menu item /
command button of some kind).
The data displayed is the one from page 3, but the datascroller shows page 1
active ("1" is bold).
How can I correct this? 
The pageIndex of the datascroller seems correct (getPageIndex() returns 3).

Jan
-- 
View this message in context: http://www.nabble.com/Datascroller-displays-incorrect-pageIndex-%281%29-tf2394335.html#a6675862
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Datascroller displays incorrect pageIndex (1)

Posted by janw <ja...@gmx.de>.
Jeff,

thanks for your assistance.
I mixed up your approach and mine: I keep the binding to the dataTable
because I need it at another place, but adopted the properties "value",
"rows", "first" as well.
Additionally, before fetching data from the DB I call 
  
  int first = getTable().getFirst();
  setRowIndex(first);

I do it manually because otw setRowIndex() is never called, though I
declared 
  
  first="#{myTableBean.rowIndex}"

Now it works :)

Jan
-- 
View this message in context: http://www.nabble.com/Datascroller-displays-incorrect-pageIndex-%281%29-tf2394335.html#a6755156
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Datascroller displays incorrect pageIndex (1)

Posted by Aneesha Govil <po...@gmail.com>.
Hi Jeff,

I am using datatable binding as well. Are there any known issues with using
as against the value, rows and first bindings?

In my usecase, I cannot use the latter because I add buttons on top of my
raw table data for navigating to the detail page etc.

I will not go ahead with this approach if it is going to be a problem later.

Please help,
Thanks,
Aneesha

On 10/6/06, Jeff Bischoff <jb...@klkurz.com> wrote:
>
> Jan,
>
> I'm not sure.
>
> Instead of binding the entire dataTable component, I bind three of its
> properties: "value", "rows", "first".
>
> I use value-binding expressions to bind these to a session bean. I don't
> bind anything to the session on the dataScroller.
>
> It's a different approach (and not necessarily the right one). My
> dataScroller seems to work reliably, though.
>
> I posted some example code to another thread [1], if you're interested
> in this approach.
>
> Also, what version of myfaces and tomahawk are you using? Could always
> be some new bug. ;)
>
> [1] http://www.nabble.com/Drill-Down-help-tf2275433.html
>
> Regards,
>
> Jeff Bischoff
> Kenneth L Kurz & Associates, Inc.
>
> janw wrote:
> > Jeff,
> >
> > I tried it without the binding, but it doesn't help.
> > table.getFirst() returns the correct result.
> > The binding of the dataTable should not be the reason, should it?
> >
> > Jan
> >
> >
> >
> >
> > Jeff Bischoff wrote:
> >> Jan,
> >>
> >> Have you tried this without binding the dataScroller? In my experience,
> >> maintaining the correct state information for the dataTable itself is
> >> sufficient. If the "first" property is set correctly on the dataTable
> >> (and it sounds like yours is), then a regular dataScroller tag should
> be
> >> able to find the right page (without being bound).
> >>
> >> Regards,
> >>
> >> Jeff Bischoff
> >> Kenneth L Kurz & Associates, Inc.
> >>
> >> janw wrote:
> >>> Hello,
> >>>
> >>> I use the dataScroller bound to a backing Bean in session scope.
> >>> The table is as well bound to the backing bean.
> >>>
> >>>   private UIData table;
> >>>   private HtmlDataScroller dataScroller;
> >>>
> >>> Scenario:
> >>> The user scrolls to page 3, goes to a completely other page, then
> returns
> >>> to
> >>> the page with the datatable (not by back button, but by a menu item /
> >>> command button of some kind).
> >>> The data displayed is the one from page 3, but the datascroller shows
> >>> page 1
> >>> active ("1" is bold).
> >>> How can I correct this?
> >>> The pageIndex of the datascroller seems correct (getPageIndex()
> returns
> >>> 3).
> >>>
> >>> Jan
> >>
> >>
> >>
> >
>
>
>

Re: Datascroller displays incorrect pageIndex (1)

Posted by Jeff Bischoff <jb...@klkurz.com>.
Jan,

I'm not sure.

Instead of binding the entire dataTable component, I bind three of its 
properties: "value", "rows", "first".

I use value-binding expressions to bind these to a session bean. I don't 
bind anything to the session on the dataScroller.

It's a different approach (and not necessarily the right one). My 
dataScroller seems to work reliably, though.

I posted some example code to another thread [1], if you're interested 
in this approach.

Also, what version of myfaces and tomahawk are you using? Could always 
be some new bug. ;)

[1] http://www.nabble.com/Drill-Down-help-tf2275433.html

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

janw wrote:
> Jeff,
> 
> I tried it without the binding, but it doesn't help.
> table.getFirst() returns the correct result.
> The binding of the dataTable should not be the reason, should it?
> 
> Jan
> 
> 
> 
> 
> Jeff Bischoff wrote:
>> Jan,
>>
>> Have you tried this without binding the dataScroller? In my experience, 
>> maintaining the correct state information for the dataTable itself is 
>> sufficient. If the "first" property is set correctly on the dataTable 
>> (and it sounds like yours is), then a regular dataScroller tag should be 
>> able to find the right page (without being bound).
>>
>> Regards,
>>
>> Jeff Bischoff
>> Kenneth L Kurz & Associates, Inc.
>>
>> janw wrote:
>>> Hello,
>>>
>>> I use the dataScroller bound to a backing Bean in session scope.
>>> The table is as well bound to the backing bean.
>>>
>>>   private UIData table;
>>>   private HtmlDataScroller dataScroller;
>>>
>>> Scenario:
>>> The user scrolls to page 3, goes to a completely other page, then returns
>>> to
>>> the page with the datatable (not by back button, but by a menu item /
>>> command button of some kind).
>>> The data displayed is the one from page 3, but the datascroller shows
>>> page 1
>>> active ("1" is bold).
>>> How can I correct this? 
>>> The pageIndex of the datascroller seems correct (getPageIndex() returns
>>> 3).
>>>
>>> Jan
>>
>>
>>
> 



Re: Datascroller displays incorrect pageIndex (1)

Posted by janw <ja...@gmx.de>.
Jeff,

I tried it without the binding, but it doesn't help.
table.getFirst() returns the correct result.
The binding of the dataTable should not be the reason, should it?

Jan




Jeff Bischoff wrote:
> 
> Jan,
> 
> Have you tried this without binding the dataScroller? In my experience, 
> maintaining the correct state information for the dataTable itself is 
> sufficient. If the "first" property is set correctly on the dataTable 
> (and it sounds like yours is), then a regular dataScroller tag should be 
> able to find the right page (without being bound).
> 
> Regards,
> 
> Jeff Bischoff
> Kenneth L Kurz & Associates, Inc.
> 
> janw wrote:
>> Hello,
>> 
>> I use the dataScroller bound to a backing Bean in session scope.
>> The table is as well bound to the backing bean.
>> 
>>   private UIData table;
>>   private HtmlDataScroller dataScroller;
>> 
>> Scenario:
>> The user scrolls to page 3, goes to a completely other page, then returns
>> to
>> the page with the datatable (not by back button, but by a menu item /
>> command button of some kind).
>> The data displayed is the one from page 3, but the datascroller shows
>> page 1
>> active ("1" is bold).
>> How can I correct this? 
>> The pageIndex of the datascroller seems correct (getPageIndex() returns
>> 3).
>> 
>> Jan
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Datascroller-displays-incorrect-pageIndex-%281%29-tf2394335.html#a6680341
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Datascroller displays incorrect pageIndex (1)

Posted by Jeff Bischoff <jb...@klkurz.com>.
Jan,

Have you tried this without binding the dataScroller? In my experience, 
maintaining the correct state information for the dataTable itself is 
sufficient. If the "first" property is set correctly on the dataTable 
(and it sounds like yours is), then a regular dataScroller tag should be 
able to find the right page (without being bound).

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

janw wrote:
> Hello,
> 
> I use the dataScroller bound to a backing Bean in session scope.
> The table is as well bound to the backing bean.
> 
>   private UIData table;
>   private HtmlDataScroller dataScroller;
> 
> Scenario:
> The user scrolls to page 3, goes to a completely other page, then returns to
> the page with the datatable (not by back button, but by a menu item /
> command button of some kind).
> The data displayed is the one from page 3, but the datascroller shows page 1
> active ("1" is bold).
> How can I correct this? 
> The pageIndex of the datascroller seems correct (getPageIndex() returns 3).
> 
> Jan