• Post Reply Bookmark Topic Watch Topic
  • New Topic

I have a tableview page in my project where I need to control the scroll position dynamically

 
tsiva raaj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a tableview page in my project where I need to control the scroll position dynamically. I tried to a lot and got the control of the table view to scroll, but the data is not changing when I change the scroll position.


==============================================================================
TableView tableView...

ScrollBar bar = getVerticalScrollbar(m_tableView);
bar.setValue(m_scrollpos);
bar.valueProperty().addListener(
new ChangeListener<Number>()
{
@Override
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
double value = newValue.doubleValue();
if(m_scrollpos > 0.0 && !isChanged){
isChanged = true;
}
else{
m_scrollpos = value;
}

ScrollBar bar = getVerticalScrollbar(m_tableView);
bar.setValue(m_scrollpos);
VirtualFlow vf = ((VirtualFlow)((TableViewSkin)m_tableVie w.getChildrenUnmodifiable().get(0)).getC hildrenUnmodifiable().get(1));
// System.out.println(vf.getFirstVisibleCel l().getIndex()+", "+vf.getLastVisibleCell().getIndex() );
m_index = vf.getLastVisibleCell().getIndex();
// m_tableView.scrollTo(m_index);

System.out.println(m_index);
}
});
======================================== ===================================
So the question is - How do I correctly handle the scroll position dynamically for my table, so that the data will change accordingly ?.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!