craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > General QuickTable Support/Help Post New Topic   Post A Reply
how can I retain vertical scrollbar position on refresh? printer friendly version
next newest post | next oldest post
Author Messages
SamB
Private

Gender: Male
Location:
Registered: Sep 2005
Status: Offline
Posts: 9

Click here to see the profile for SamB Send email to SamB Send private message to SamB Find more posts by SamB Edit or delete this message Reply w/Quote
Posted Wednesday, May 25, 2011 @ 08:11:16  

Whenever I call dBTable1.refresh() to re-fetch data from the database the vertical scroll bar
always goes back to the top. How can I make it stay where it was before the refresh() call,
with the appropriate row still showing? I tried putting a dBTable1.useOldColumnProperties(true)
just before the refresh but nothing changed.
Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Saturday, May 28, 2011 @ 02:20:40  

you can scroll to the row using scrollToCell(int row, int column)
SamB
Private

Gender: Male
Location:
Registered: Sep 2005
Status: Offline
Posts: 9

Click here to see the profile for SamB Send email to SamB Send private message to SamB Find more posts by SamB Edit or delete this message Reply w/Quote
Posted Tuesday, May 31, 2011 @ 09:44:51  

OK, so how do I determine which row is top (or other) visible row before I do the refresh??

Then I presume I can do a save - refresh - scrollto sequence.

These are read-only tables, so I cant count on the user having actually selected a row.

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Wednesday, June 1, 2011 @ 21:58:45  

to get position use

Point upperLeft = scrollPane.getViewPort().getViewPosition();
int firstVisibleRow = table.rowAtPoint(upperLeft);
int firstVisibleColumn = table.columnAtPoint(upperLeft);

To get scrollpane used by quicktable , try dbTable.getTable().getParent(); I haven't tried this. use this idea.

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios