Hi,
I'm having problems using the setTopIndex() method of the Table widget, the problem is the following: when I want to display a row that is not showing in a table the setTopIndex() works fine, but if the table has TableEditor in its rows it behaves oddly, it scrolls its scrollbar but the elements don't.

Hi,
in ControlEditor there are listeners registered on Table/Tree scrollbars
which do the layout of the editor control when scrollbar selection
changes. These listeners are not notified in both RAP and SWT when
setTopIndex method is used. You could try to notify these listeners
manually:
....
table.setTopIndex( index );
ScrollBar vBar = table.getVerticalBar();
if( vBar != null ) {
vBar.notifyListeners( SWT.Selection, new Event() );
}
....
HTH,
Ivan

On 6/13/2013 1:19 AM, Jesus Luna Quiroga wrote:
> Hi, I'm having problems using the setTopIndex() method of the Table
> widget, the problem is the following: when I want to display a row
> that is not showing in a table the setTopIndex() works fine, but if
> the table has TableEditor in its rows it behaves oddly, it scrolls its
> scrollbar but the elements don't.
>
> This code should show the problem:
>
> final Table table = new Table(this, SWT.BORDER | SWT.MULTI);
> table.setSize(200, 200);
> TableColumn tc = new TableColumn(table, SWT.NONE);
> tc.setText("Column 1");
> tc.setWidth(200);
> for (int i = 0; i < 100; i++) {
> TableItem item = new TableItem(table, SWT.NONE);
> Text text = new Text(table, SWT.NONE);
> text.setText( "item " + i);
> TableEditor editor = new TableEditor (table);
> editor.grabHorizontal = true;
> editor.setEditor(text, item, 0);
> editor.layout();
> }
> Button btn = new Button(this, SWT.NONE);
> btn.setText("Click");
> btn.addSelectionListener(new SelectionListener(){
> public void widgetSelected(SelectionEvent e) {
> table.setTopIndex(95);
> }
> public void widgetDefaultSelected(SelectionEvent e) {}
> });
>
>
> I've tried to do a workaround but nothing worked, I've tried to scroll
> the table, use its layout() and so on. Also I've seen this is a common
> problem in SWT.
>
> So can you help me with this, does a workaround exists? or is it a bug?
>
> Thanks in advance.
>
>