Hi,
I too had a similar requirement. I created a new view in the same component thought.
In my case also i wanted almost the same behaviour except redefine a few methods and i too found it was affecting my standard view.
The issue is that since we are copying, the view controller defines the context classes which are same as that of standard. So, u will have to work a bit this the view controller class (IMPL) of the copied view.
- U need to create a few empty classes ie CTXT class and context node classes CN00 so on all with super classes the respective standard classes
- Redefine method wd_create_context, pass the value of the custom class
* create the context
context = cl_bsp_wd_context=>get_instance(
iv_controller = me
iv_type = 'ZL_<ur empty class>' ). "#standard class
- In the CTXT class, redefine the method Create_<nodename1>, pass the empty class with superclass the standard one.
change the part referring to the context node class,
METHOD create_<nodename>.
DATA:
model TYPE REF TO if_bsp_model,
lr_view_controller TYPE REF TO standard impl class.
model = owner->create_model(
class_name = 'ZL_<classname>_CN01' "#CL_<standard class>_CN01
model_id = '<nodename>' ).
mreaddoc ?= model.
CLEAR model.
lr_view_controller ?= me->owner.
IF lr_view_controller IS BOUND.
<nodename>->comp_controller ?= lr_view_controller->get_comp_controller( ).
ENDIF.
ENDMETHOD.
- repeat for the other nodes whose method u want to change.
The advantage is that i have all the context node classes in a custom classes with a superclass inheritance. So, even thou i change the methods of this custom class, i doesnt disturb behaviour of the standard.
It was the idea i came up with, it worked for me but i never tried looking for other way to solve it.
-
Anish