Skip to Content
author's profile photo Former Member
Former Member

TableView item selection problems

Detlev, if you are out there, please help!

I have been trying to follow the doc and examples for selecting an item in a TableView. I have got the event to fire, but there is no such event as TableSelectionEvent, instead you must use TableRowSelectionEvent.

Also, this does not have the promised getRowIndex() method. The javadoc say you can get the selected row from Event.getParams(), but this returns null!

Furthermore, SAP have a working example of selecting TableView rows and keeping the selection, but the code samples cannot possibly be from the working example.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 24, 2005 at 03:44 PM

    Try the following:

    TableRowSelectionEvent trse = (TableRowSelectionEvent) event;
    TableView table = (TableView) this.getComponentByName("table");
    int realSelectedRow =
    	trse.getVisibleRowIndex()
    	+ table.getVisibleFirstRow()
    	- 1;

    Brian

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 24, 2005 at 05:18 PM

    Hi Martin,

    just in addition to Brian's answer, see How to use onRowSelection !!!! for further discussions - and with that, maybe you'll like the idea of using search functionality of SDN 😊

    And if you ask that directly for my help --- please give some respect to my ending notes on How to create datasource alias in EP project? ... Your misfortune is that I have a quite good memory... 😊

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Mmmm... Before I post I normally do a search first to see if it brings up anything. Maybe the search terms I entered weren't so good...

      Anyway, I have gone back and rewarded all the answers accordingly. Sorry about that, and thanks for all your help!

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.