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

How to use onRowSelection !!!!

Hi,

very new to EP and I Was working on tableviews where had mentioned the onRowSelection event can anyone tell me how to work with this event and also how to get data of the selected row, i need to know this very badly, so plz can anyone help.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 21, 2004 at 12:18 PM

    Hi!

    There are some good examples in EP(User Interface Development->HTMLB->Additional Examples using Models->tableView).

    I think you could do something like that:

    public void onMyOnRowSelection(Event event) throws PageException {
    		TableRowSelectionEvent r = (TableRowSelectionEvent)event;		
    		int realSelectedRow = r.getVisibleRowIndex() + Integer.parseInt(myBean.getVisibleRow()) - 1;	
    String valueForCol1 = myBean.getModel().getValueAt(realSelectedRow, 1).toString();
    }
    

    "myBean" is your TableViewBean. There you can set the visible at the NavigationEvents... you can see this in the examples...

    Best Regards,

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 21, 2004 at 12:01 PM

    Hello,

    I implemented this a long time ago so I'll do my best:

    TableView table = (TableView) this.getComponentByName("backenTV");
    int ns = 0;
    
    			
    for (int i = 1; i <= table.getRowCount(); i++) {
       if ((table.isRowSelected(i))) {
    	ns = i;
        }
    }
    

    After this You can read out the line of the TableViewModel an access the values.

    Good luck and try it.

    Walter

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 21, 2004 at 12:08 PM

    Hi,

    you have to define the method, which will be started, when the event occured:

    myTableView.setOnRowSelection("onRowSelection");

    In the Main-Class you have to implement this method like:

    public void onRowSelection (Event event) {

    TableView table = (TableView) this.getComponentByName("myTableView");

    }

    Regards,

    Gerhard

    Add a comment
    10|10000 characters needed characters exceeded

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.