Skip to Content
0
Former Member
Nov 28, 2005 at 11:17 AM

Getting tableview selectedrowindex from subcontroller

33 Views

Hi experts,

I have a tableview created by one of my sub views.

Please see the following image link for my design:

http://img203.imageshack.us/img203/2298/subcontrollers6ub.gif

The view with the red border is the one displaying the iterator/tableview.

I need to get the selected row index in my main controller (MAIN.DO)

In my main controller's DO_HANDLE_EVENT, the following code works only IF the iterator resides in "Page1.htm".

The iterator is now located in Page1_Sub2.htm.

   WHEN 'getChange_exprep'.
      tbv ?= CL_HTMLB_MANAGER=>GET_DATA( request = request
                                         name    = 'tableView'
                                         id      = 'tbv_ExpRep' ).

      IF tbv IS NOT INITIAL.
        tbv_event = tbv->data.
        selectedRowIndex = tbv_event->SELECTEDROWINDEX.
        IF selectedRowIndex <> 0.
          DELETE model->AT_IUI_COSTASSIGNTRIP INDEX selectedRowIndex.
        ENDIF.
      ENDIF.

I can get a reference to my subcontroller from my main controller, but i don't know how that can help.

Any idea?

Message was edited by: Kevin Wong