Table and scroll Position

Hi everybody !

I’ve got a small problem withTable component to set scroll position with the following methods :

  • setCurrentPageFirstItemId
  • setCurrentPageFirstItemIndex
  • select
    My problem : When I use setCurrentPageFirstItemIndex or setCurrentPageFirstItemId scroll position works fine and all my item’s table are refreshed. But if I use select method (to select my Item) with the previous methods, scroll position works fine but some Items under my selected item are not displayed into the table. I need to manually scroll my table to display items who’s missing. Could you explain that ? Maybe I do something wrong. Moreover if I use setCurrentPageFirstItemId or setCurrentPageFirstItemIndex or select into a listener for select my item my table is not refresh. I suppose that’s not a bug, it’s probably just a table refresh to enable.

Thanks for you help !

Any idea ? :frowning:
Well In the same way I’ve got an another strange thing when I scroll Table with some data, all my table, layout, window disappear then reappear to refresh my scroll table position. This problem is more frequent when my table contains more than 20000 items and when I use TabSheet.
If you can tell me why, thanks in advance !

On your first problem, I have really no idea :frowning:

For the refresh problem…
I think it come from the fact that when you close a window, or change scroll, the table component will be repainted.
So it really depend on how you repaint your component. Did you overide the requestRepaint() method on your Table ? Or do you do anything, say, on selection change, or item adding ?

I see that in your table, you have more than 20K elements ? That may be the source of all your trouble ^^
Going throught all those elements in order to display the right ones must take at least from half a second to a second - even more if your elements are complicated things (basicaly anything more than a couple Strings ^^).

Maybe try with a less charged table, it should solve some of your troubles :slight_smile:

Quentin.

Thanks for your answer about my problem.
Currently I’m not overide requestRepaint method and if I remove table’s listener my problem is the same. Today I’m going to try new methods to display my table but I’m not sure if I will find a solution to fix it …
I think my scroll problem come from TabSheet because if I don’t use it I can scroll all my table (22k items, 24 columns) without problem very strange. :shock:
We keep in touch about that.

Hi Thomas!

It is currently quite hard to say where is the problem as it is pretty hard to reproduce.

Try to reduce the problem to as small as possible and then give an example code.

What browser are you using? Does it work with other browsers?

What is the version on your IT Mill Toolkit library?

matti

Hi Matti,

I use It Mill 5.2.5 with Firefox v3.0.1 and the I can’t reproduce the problem under Opera (v9.50) because it’s too long to load data into my table.
I Notice if I use setSizeFull on my TabSheet who contains my table the problem is worst ! If I remove my tabSheet and Display my table on the main Windows it seems to work fine.

I confirm that my problem comes form TabSheet because if I display my table on window I don’t have the problem during scroolling.

Hi Thomas,

Is the Table in Tabsheet set to fill whole tabsheet and this way larger than the one in window?

If so then I most likely have a solution for you. Use table.setPagelenght() to set default row number larger. In Toolkit 3 era aka Millstone this was the only way to define Table height. Due the history it is still there to define the amount of rows that are sent to client by default. If your table on your display can show 25 rows at ones, set pagelength to 30 or event 50 and it should work.

I hope to have some time to fix
http://dev.itmill.com/ticket/1623
to get rid of this problem.

cheers,
matti

Hi Matti ! and thanks a lot for your answer.

Sorry about that but I don’t really understand (need to improve my english) what you mean when you ask me :

If you tell me if my Table take all TabSheet’s space (width/height), it’s my case.
My application works like this :

  • mainWindow (Height/Width at 100%) with
  • TabSheet (Height/Width at 100%) with
  • MyTable extends CustomComponent contains ExpandLayout (Root Component) who contains my Table (Height/Width 100%).

About my problem, I tried to set PageLenght() on my table but the problem is still here :frowning: and setPageLenght on table increase table loading :

  • Time with SetPageLenght on table : 28927 ms = (0h0mn 28s)
  • Time without SetPageLenght on table : 2701 ms = (0h0mn 2s)
    (Tested with 1000 items 24 columns)

To resume and add more precisions about my problem :

  • If I set table into a TabSheet and scroll it : All TabSheet component (include child component) disappears from my window then reappears when scrolling is done.
  • If set table directly on Window (without TabSheet) and scroll it : All works fine.

Hi!

I think I finally got after your issue. It is like the TabSheet “flashes” in browsers (and then contained table looses its scroll position)?

We have a small design problem in our TabSheet component due which we need to repaint TabSheet when contained component changes. That is where the flashing comes from. In FF3 this can be seen, in Safari it is almost impossible to detect.

I’ll make fixing this bug a top priority. If you have a good reduced test case, feel free to attach it to
http://dev.itmill.com/ticket/1969

matti

Thanks for your explanation I will upload an example in few minute on Trac. I hope this will can help you.