You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Andreas Zeller - zit-systems <an...@zit-systems.de> on 2006/01/21 07:28:52 UTC

DataScroller index

Hello there,

I have a simple question, just don't seem to get to the bottom of the
problem. How do I _stay_ at a specific pageIndex of a datascroller? I
have inline-editing with a really huge database in the background.

My setup is as follows: As soon as I edit a record, an action forwards
me to my editpage, where all the other records' editing fields are
disabled but the one I selected for editing. There's a "lock" flag in
the DB, so it stays open for editing. The only problem is, that the
datascroller sends me back to the first scroller-page the moment I
forward to the editpage. I want the user to stay on the scroller-page he
originally clicked the edit-button on.

There's a lot of javascript in the generated html-sourcecode of the
datascroller, so I can't quite figure how it actually works. Is there
some kind of simple request parameter or scope attribute I might want to
set for the current page, so the scroller index stays where it is unless
I click something else?

I'd be very grateful for any hints on that.

Andreas

Re: DataScroller index

Posted by Marco <ma...@gmail.com>.
Hi Andreas;

Have a look at this:

http://myfaces.apache.org/tomahawk/dataScroller.html
http://myfaces.apache.org/tomahawk/extDataTable.html

Marco

Re: DataScroller index

Posted by Andreas Zeller - zit-systems <an...@zit-systems.de>.
Hey Marco,

I got the idea of the datatable and scroller. My problem is, as how to
access these values. There is an actual "pageIndexVar" attribute in the
dataScroller, which seems to be giving me control to what page is being
displayed. But where exactly is this attribute set? Is it within EL, so
I can access it via FacesContext by just creating a value-binding to
#{pageIndex} and setting it again for the next request? I tried that, it
won't work either...

And where would I bind the object to? To the table or to the scroller? I
just want the table to stay the way it is... Changing the table is not
what I want to. I just want back to the original index. What is this
pageIndexVar attribute for, anyway?

Andreas


Marco wrote:

> Hi Andreas;
>
> Going to a specific page in the dataScroller depends on the (rows &
> first) attributes of the dataTable.
>
> 1) The rows attribute - is the # of displayed rows per page (default
> is 10).
> 2) The first attribute - is the index of the first displayed row
> (default is 0).
>
> So for example if your total number of rows is 20 and the rows
> attribute was 10:
> 1) You want to show results from 1 to 10 (1st page in the scroller)
> simply make (first=0).
> 2) You want to show results from 11 to 20 (2st page in the scroller)
> simply make (first=10).
>
> Make a value binding in you managed bean to those two attributes and
> then you have the full control of what is displayed in the dataTable.
>
> Marco
>
>


Re: DataScroller index

Posted by Marco <ma...@gmail.com>.
Hi Andreas;

Going to a specific page in the dataScroller depends on the (rows &
first)attributes of the dataTable.

1) The rows attribute - is the # of displayed rows per page (default is 10).
2) The first attribute - is the index of the first displayed row (default is
0).

So for example if your total number of rows is 20 and the rows attribute was
10:
1) You want to show results from 1 to 10 (1st page in the scroller) simply
make (first=0).
2) You want to show results from 11 to 20 (2st page in the scroller) simply
make (first=10).

Make a value binding in you managed bean to those two attributes and then
you have the full control of what is displayed in the dataTable.

Marco