Skip to Content
Oct 05, 2006 at 02:13 PM

data binding problem


Hi Guys

I try to use data binding in a subcontroller. My problem now is, that if I register my global model in this controller by using set_model( ), the binding aint working. The model I register was created in the parent-controller. If I use create_model( ) instead, the binding is working perfectly.

This is the coding of the do_init method of my subcontroller:

METHOD do_init .

  DATA: l_parent TYPE REF TO cl_bsp_controller2.

* downcast super-controller and get model
  l_parent ?= m_parent.
  m_model ?= l_parent->get_model( model_id = 'data_form' ).

* register model in this controller
  set_model( model_id = 'data_form' model_instance = m_model ).

If I create the model like this, the binding works:

METHOD do_init .
* create model
  m_model ?= create_model(
               model_id   = 'data_form'
               class_name = 'ZCL_IM_C3_MO_KNW2_DATA' ).


In both cases m_model is of type ref to ZCL_IM_C3_MO_KNW2_DATA.

I found mvc-sub-controller-event-handling-for-tabstrip post, where max explained exactly this part of the logic (second last reply on the first page).

Does anyone have an idea what could be the problem?

Thanks in advance.