Scroll position in a table by setCurrentPageFirstItemId()

Hi!
I have a problem with the function setCurrentPageFirstItemId():

when I use this function on a table whose rows are all visible on the screen and then scroll bar is not necessary, the FIRST row of the table is CLEARED.
The number of rows of my table is variable so sometimes there is a scroll bar sometimes it does not, how can I avoid using this function if it is not necessary?

Is there somebody having the same problem? Thanks !

Has nobody a solution for me?