cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding HTMLB Tableview iterator

Former Member
0 Kudos

Hi All,

I am working on tableview iterator example from Brian's weblog:

[Iterator|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/213] [original link is broken] [original link is broken] [original link is broken];

I modified the TV in BSP to multilineedit .

I Filled the curriencies table in constructor with three values ie USD , INR and GBP .

Now suppose , i select INR in first row for curriencies , when i select the second row ,

this value is initialised to USD which is the first entry in curriencies table.

What changes are requied in the iterator class so that the selection is not lost?

Note-> there are no entries for the field "currency" in SFLIGHT in my IDES.

Thanks,

Vivek.

Accepted Solutions (1)

Accepted Solutions (1)

former_member416498
Active Participant
0 Kudos

Hi vivek

Once the user changes the currency in the dropdown generate a server trip and capture the value of the dropdown to your internal table. Then this will help you in retaining the values.

Former Member
0 Kudos

Hi Vijaya,

I can generate a server round trip by using onselect attribute in the iterator....but how to go about

capture the value of the dropdown to your internal table.

Can you please help me with a code sample or explain in detail..how to do this.

Thanks,

Vivek.

former_member416498
Active Participant
0 Kudos

Now after giving the eventname in onSelect for the dropdown the server event will be triggered. Then in the event "onInputprocessing" you can caputure this event and write the code.

data: tv_cdi TYPE REF TO cl_htmlb_tableview,

tv_cdi_event TYPE REF TO cl_htmlb_event_tableview,

WHEN 'status'.

tv_cdi ?= cl_htmlb_manager=>get_data(

request = runtime->server->request

name = 'TABLEVIEW'

id = 'tv_tb' ).

tv_cdi_event = tv_cdi->data.

row = tv_cdi_event->prevselectedrowindex.

if tv_cdi_event->prevselectedrowindex IS NOT INITIAL.

//using this method get the value of the cells in the table.

//If you want all the rows and cell you can loop and get the //data of the cells.

tv_cdi_event->get_cell_value( row_index = row

column_index = col ).

endif.

// once you get the value u can modify your internal table as you know the index of the row you have captured.

endif.

////// Rest of event of your code.

Hope this will be helpful to you.

Vijay

Former Member
0 Kudos

Hi Vijaya,

It worked after some minor modifications:

DATA: tv_cdi TYPE REF TO cl_htmlb_tableview,
      event  TYPE REF TO if_htmlb_data,
      ddlb_event        TYPE REF TO cl_htmlb_event_selection,
      tv_cdi_event type ref to cl_htmlb_event_tableview.
DATA:row type i .
data: val type string .

event = cl_htmlb_manager=>get_event( request ).


IF event IS NOT INITIAL AND event->event_name = htmlb_events=>dropdownlistbox .
  
  ddlb_event ?= event .
  CASE event->event_server_name.

    WHEN 'curr'.
      tv_cdi ?= cl_htmlb_manager=>get_data(
      request = runtime->server->request
      name = 'TABLEVIEW'
      id = 'tv1' ).
      tv_cdi_event = tv_cdi->data.
      row = tv_cdi_event->prevselectedrowindex.
      
      if tv_cdi_event->prevselectedrowindex IS NOT INITIAL.
    val = tv_cdi_event->get_cell_value( row_index = row
     column_index = '6' ).
endif.

  ENDCASE.
ENDIF.

Many thanks for your time..i am opening a new thread for a related question , please see at your convenience if you can help me in that as well...

Regards,

Vivek.

Answers (0)