| Summary: | [Table] getSelectionIndex() returns -1 after checking/unchecking a checkbox | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Manuel Penker <m.penker> |
| Component: | JFace | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
Are you sure that this works in SWT? I've just check it with SWT Controls Demo ( SWT 3.6M6 ) and the checkbox checked/unchecked does not change the selected item - selectionIndex = -1, visually item is not selected. The only difference with your example is that the Table in SWT Controls Demo is not VIRTUAL. (In reply to comment #1) > Are you sure that this works in SWT? I've just check it with SWT Controls Demo > ( SWT 3.6M6 ) and the checkbox checked/unchecked does not change the selected > item - selectionIndex = -1, visually item is not selected. The only difference > with your example is that the Table in SWT Controls Demo is not VIRTUAL. The table is assigned to a TableViewer like: TableViewer tableViewer = new TableViewer(table); Perhaps the tableViewer has the propblem to deal with the table. Behaviour in RCP: If I check a checkbox in RCP the whole tablerow will be selected - so, I will get the selection index Behaviour in RAP: If I check a checkbox in RAP no tablerow will be selected - so, the selection index = -1 I can't reproduce the described RCP behavior with/without TableViewer on Windows. BTW, are you using Linux? Can you provide a complete snippet to reproduce it? (In reply to comment #3) > I can't reproduce the described RCP behavior with/without TableViewer on > Windows. BTW, are you using Linux? Can you provide a complete snippet to > reproduce it? You're right. Under Windows I will have the same problem in our RCP application. If I start our RCP application under Ubuntu Linux the selection works as described. I will close it as WONTFIX as RAP generally respects the Windows SWT behavior. |
Build Identifier: 20090920-1017 Table table = new Table(parent, SWT.BORDER | SWT.VIRTUAL | SWT.FULL_SELECTION | SWT.CHECK); table.addListener(SWT.Selection, new Listener() { /** {@inheritDoc} */ public void handleEvent(final Event event) { if (event.detail == SWT.CHECK) { int index = table.getSelectionIndex(); } } }); The table.getSelectionIndex() returns -1. If you test the same example in RCP, the getSelectionIndex() works fine!! Reproducible: Always Steps to Reproduce: 1. check/uncheck a checkbox within a table directly (Don't click on the table row - here the selection index still works) 2. The checkbox will be checked/unchecked, the table row isn't selected 3. The table listener event will be called and the selection index = -1