cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with tableview data storing

Former Member
0 Kudos

Hi,

We are using MVC model, it has view-model-main controller and sub controller. I am displaying

4 columns on the tableview where 2 columns are editable. when i click update button on the screen

i have called do_handle_event method on sub controller, when i debug the code i am getting

table as initial always. I am not sure what am i missing here..can any one help me ?

Here is code

method DO_HANDLE_EVENT

data: o_event type ref to cl_htmlb_event,

visible_row type int4,

visible_last_row type int4,

visrow_count type int4 value 10,

it_osha like line of it_mfgprf_osha,

wa_osha type zpp1_mfgprf_osha,

o_app type ref to zcl_mfg_perf.

o_event = cl_htmlb_manager=>get_event( request ).

if o_event is not initial.

if o_event->id = 'osha_update'.

data: tv type ref to cl_htmlb_tableview.

tv ?= cl_htmlb_manager=>get_data(

request = runtime->server->request

name = 'tableView'

id = 'it_osha_history' ).

if tv is not initial.

data: tv_data type ref to cl_htmlb_event_tableview.

tv_data = tv->data.

if it_mfgprf_osha is not initial.

visible_row = tv_data->visiblefirstrowindex.

visible_last_row = visrow_count + visible_row - 1.

loop at it_mfgprf_osha into it_osha

from visible_row to visible_last_row.

it_osha-zosha_ytd = tv_data->get_cell_value(

row_index = sy-tabix column_index = 3 ).

endloop.

endif.

endif.

endif.

endif.

view

<htmlb:tableView id = "it_osha_history"

table = "<%=o_app->it_mfgprf_osha%>"

iterator = "<%=o_cont->osha_iterator%>"

headerText = "OSHA History"

headerVisible = "True"

sort = "SERVER"

onHeaderClick = "sort"

visibleRowCount = "10"

width = "100%"

design = "ALTERNATING"

allRowsEditable = "<%=o_app->ALLOW_RECORD_EDIT%>" />

Thanks!

Lakshmikandh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hai Lakshmikandh,

before you use the do handle event u have to get all the screen fields into the table using 'do_handle_data' method in the controller class.

thanks,

raju.

Message was edited by: krishnam raju

Former Member
0 Kudos

Hi,

why don't you use a model-class and let the framework do the rest? Respecting it's a MODEL View Controller solution.

Regards,

Sebastian

Former Member
0 Kudos

Hi Guys,

Thanks for valuable suggestion. Let me give you over view of application. We have sub-controller

for all views, one controller and one model for those sub controllers and views.

Hi Sebastian,

Are you suggesting to use new model for all table view iterator ?

If i use iterator on that one model i can't use

that for other table view iterator..right ?

Hi raju,

If i get all the values on 'do_handle_data' method in the controller class, can i use that

for other table view iterator if i create a new table view iterator? can i have some

outline(example coding) of passing those values to sub controller ?

Thanks in advance.

Lakshmikandh

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

As Sebastian suggest you that you have to use the model class and fill your internal table there. But I think u have redefine the Do_handle_data method of main controller but not pass the values to it. Pass the values in following way to DO_HANDLE_DATA.

CALL METHOD SUPER->DO_HANDLE_DATA

EXPORTING

FORM_FIELDS = form_fields

GLOBAL_MESSAGES = GLOBAL_MESSAGES.

regards,

Aashish Garg

Former Member
0 Kudos

I was not referring application class internal table, so internal table always on initial mode. I have solved it.

Thanks!

Lakshmikandh

Former Member
0 Kudos

I hope, tableview values are not passed to sub controller. any idea how to get those values ?.