Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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 ?.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic