Skip to Content
0
Former Member
Jul 29, 2005 at 01:11 PM

HTMLB TableViewIterator and Event

24 Views

Hello,

I am reading a table and display the table via HTMLB TableView. I created an tableviewIterator and when you select a line, the "Quantity Field" is open for edit.

So far so good.

When you select the next line, everything is fine and the table is updated with the new quantity value.

When everything is finished, the user is supposed to hit the "Post" button.

But I need to capture the last event, that the user, at the end of the very last entry does NOT select another line to update the table. Probably, the user will hit just the "post" button. Since this will be a big user community, I cannot rely on the fact that everybody will hit another select-line just for saving the entry.

What would be the code/event/strategy to capture the last value that is still in the edit-field of the table, but is not confirmed yet

I experimented with one "Add" button, but I don't know how to trigger the "Next row selected" method in this case. I have a knowledge gap here, for sure.

I have read most of the TableViewIterator samples, but I am missing the "edit" topic. I have read one event tutorial, but I am somewhat lost in the options, which method/object would be helpful for my problem

My code in the OnInputProcessing :

event = CL_HTMLB_MANAGER=>get_event( request ).

if event is not initial AND

event->name eq 'tableView' AND

event->id eq 'tvX' AND

( event->event_type eq CL_HTMLB_EVENT_TABLEVIEW=>CO_CELL_CLICK

or

event->event_type eq

CL_HTMLB_EVENT_TABLEVIEW=>CO_ROW_SELECTION ).

table_event ?= event.

selectedRowIndex = table_event->row_Index.

endif.

tv ?= CL_HTMLB_MANAGER=>GET_DATA(

request = runtime->server->request

name = 'tableView'

id = 'msku_table' ).

IF tv IS NOT INITIAL.

tv_data = tv->data.

IF tv_data->SelectedRowIndex IS NOT INITIAL.

READ TABLE IT_MSKU INDEX tv_data->prevSelectedRowIndex ASSIGNING

<row>.

value = tv_data->GET_CELL_ID(

row_index = tv_data->prevSelectedRowIndex

column_index = '7' ).

inputfield ?= CL_HTMLB_MANAGER=>GET_DATA(

request = request

name = 'inputField'

id = value ).

if inputField->value is not initial.

q = inputField->value.

REPLACE ALL OCCURRENCES OF ',' IN q WITH '.'.

<row>-KULAB_X = q.

ENDIF. "input is initial.

ENDIF. "row is initial.

ENDIF. "tv is initial.

  • ENDIF. "event id htmlb.