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?
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
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.
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
>
"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.
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)
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.