Skip to main content


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 16:22 Go to next message
Ivan is currently offline IvanFriend
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 08:32 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
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 14:12 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
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 15:05 Go to previous messageGo to next message
Ivan is currently offline IvanFriend
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] Sat, 04 June 2005 03:46 Go to previous messageGo to next message
AJ Barnes is currently offline AJ BarnesFriend
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 08:09 Go to previous messageGo to next message
Ivan is currently offline IvanFriend
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 06:24 Go to previous message
Don Young is currently offline Don YoungFriend
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: Thu Apr 18 07:07:09 GMT 2024

Powered by FUDForum. Page generated in 0.01892 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top