Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Table with paging
Table with paging [message #456371] Wed, 01 June 2005 12:22 Go to next message
Ivan is currently offline Ivan
Messages: 149
Registered: July 2009
Senior Member
Hi all,
I have an application that shows in a Table a quite large amount of data.
Till now I let the Table to be "scrollable", but I would like to introduce
a sort of paging (for example, the Table shows only 10 rows and then with
two buttons NEXT and PREV the user can look at the data) but I am not able
to find some help/snippet to do it.
Does anybody have some idea? Does anybody already implemented something
like that?

Thanks in advance.

Ivan
Re: Table with paging [message #456392 is a reply to message #456371] Thu, 02 June 2005 04:32 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 97
Registered: July 2009
Member
Does Table do this automatically with Page-Up Page-Down,
up-arrow and down-arrow? If this doen't work, you can add
key listeners to Table and handle events manually.

Regards.


"Ivan" <zorziivan83@hotmail.com> wrote in message
news:0838f0debb995f0cd29b745f2c1149c4$1@www.eclipse.org...
> Hi all, I have an application that shows in a Table a quite large amount
> of data. Till now I let the Table to be "scrollable", but I would like to
> introduce a sort of paging (for example, the Table shows only 10 rows and
> then with two buttons NEXT and PREV the user can look at the data) but I
> am not able to find some help/snippet to do it.
> Does anybody have some idea? Does anybody already implemented something
> like that?
>
> Thanks in advance.
>
> Ivan
Re: Table with paging [message #456403 is a reply to message #456371] Thu, 02 June 2005 10:12 Go to previous messageGo to next message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
Hi Ivan,

If I understand your description correctly, it sounds like you just want to
dispose() all old TableItems and create a new set of TableItems whenever the
user pages up or down, right? If so then there's no magic way to do this
beyond what's described in the previous sentence.

However, a follow-up question: Is your motive for doing this that populating
your Table with a large amount of data upfront is too expensive? If so then
SWT.VIRTUAL is your friend since it allows you to fill in TableItems only as
they're needed (ie.- scrolled to by the user). For an example of this see
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet144.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup .

If neither of these suggestions answered what you're looking for then please
follow up.

Grant

"Ivan" <zorziivan83@hotmail.com> wrote in message
news:0838f0debb995f0cd29b745f2c1149c4$1@www.eclipse.org...
> Hi all,
> I have an application that shows in a Table a quite large amount of data.
> Till now I let the Table to be "scrollable", but I would like to introduce
> a sort of paging (for example, the Table shows only 10 rows and then with
> two buttons NEXT and PREV the user can look at the data) but I am not able
> to find some help/snippet to do it.
> Does anybody have some idea? Does anybody already implemented something
> like that?
>
> Thanks in advance.
>
> Ivan
>
Re: Table with paging [message #456406 is a reply to message #456403] Thu, 02 June 2005 11:05 Go to previous messageGo to next message
Ivan is currently offline Ivan
Messages: 149
Registered: July 2009
Senior Member
"Is your motive for doing this that populating
your Table with a large amount of data upfront is too expensive?"

No, it is not a problem of large amount of data. I want just to find a way
to show the user the data in good format. It would be more clear to the
user to look at only some rows at any one time, instead of scrolling all
the data retrieved from the DB.


Ivan
Re: Table with paging [message #456447 is a reply to message #456371] Fri, 03 June 2005 23:46 Go to previous messageGo to next message
AJ Barnes is currently offline AJ Barnes
Messages: 2
Registered: July 2009
Junior Member
Ivan,

If you used a JFace TableViewer you could use a filter to show only
(e.g.) 25 records at a time. Intially allow records with ID between 1
and 25 to be shown. If the 'Next' button is pressed modify the filter to
show records with IDs between 26 and 50. I've used similar (with drop
down list) for showing just top 10, 20, or 50 records.

A.J.

Ivan wrote:
> I would like
> to introduce a sort of paging (for example, the Table shows only 10 rows
> and then with two buttons NEXT and PREV the user can look at the data)
Re: Table with paging [message #456694 is a reply to message #456447] Tue, 07 June 2005 04:09 Go to previous messageGo to next message
Ivan is currently offline Ivan
Messages: 149
Registered: July 2009
Senior Member
Hi A.J.!
Do you have a snippet to understand better how to do it?

Ivan
Re: Table with paging [message #460234 is a reply to message #456371] Tue, 23 August 2005 02:24 Go to previous message
Don Young is currently offline Don Young
Messages: 18
Registered: July 2009
Junior Member
Ivan wrote:
> Hi all, I have an application that shows in a Table a quite large amount
> of data. Till now I let the Table to be "scrollable", but I would like
> to introduce a sort of paging (for example, the Table shows only 10 rows
> and then with two buttons NEXT and PREV the user can look at the data)
> but I am not able to find some help/snippet to do it.
> Does anybody have some idea? Does anybody already implemented something
> like that?
>
> Thanks in advance.
>
> Ivan


We have been wanting to doing so and the TableViewer even with VIRTUAL
is harder to program than Swing's table. We however have found KTable
and it is much easier to doing this kind of work.

-Don
Previous Topic:How to Minisized A CTabFolder in SashForm
Next Topic:Showing a table in View
Goto Forum:
  


Current Time: Tue Jul 22 03:21:28 EDT 2014

Powered by FUDForum. Page generated in 0.12277 seconds