on 09-05-2013 7:00 AM
Hi,
my coding in my View workes fine.
DATA lo_view TYPE REF TO if_wd_view.
DATA lo_buttonchoice TYPE REF TO cl_wd_button_choice.
DATA lo_menuactionitem TYPE REF TO cl_wd_menu_action_item.
* Get a reference to the ButtonChoice view object
lo_view ?= wd_this->wd_get_api( ).
lo_buttonchoice ?= lo_view->get_element( 'LV_1_BUTTON' ).
lo_buttonchoice->SET_SELECTED_ACTION_ITEM( 'RUF_1_NEUTRAL' ).
But when i try to convert this in my component Controller as a Method i get an Error
Dynamischer Typkonflikt bei Zuweisung von Referenzen
i think because of my variable "lo_view"
Because this Method is started in my CC maybe he needet the view first ?
please help me
i Created an Context-Attribute in my View
VIEW_WD_IF type ref to IF_WD_VIEW
Then in the Method WDDOMODIFYVIEW
i exportet the View Parameter to my context attribute VIEW_WD_IF
My Attribute was mapped with my CC so now i can easily use the Attribute in my CC Method for my Button Choice Method.
I used this coding im my CC Method
* get single attribute
LO_EL_VIEW_DETAILS->GET_ATTRIBUTE( EXPORTING NAME = `VIEW_WD_IF`
IMPORTING VALUE = LV_VIEW_WD_IF ).
LV_VIEW_WD_IF->GET_ELEMENT( BUTTON_CHOICE_ID ).
DATA LO_BUTTONCHOICE TYPE REF TO CL_WD_BUTTON_CHOICE.
DATA LO_MENUACTIONITEM TYPE REF TO CL_WD_MENU_ACTION_ITEM.
* Button wird auf Neutral zurückgesetzt
LO_BUTTONCHOICE ?= LV_VIEW_WD_IF->GET_ELEMENT( BUTTON_CHOICE_ID ).
LO_BUTTONCHOICE->SET_SELECTED_ACTION_ITEM( ACTION_ITEM_ID ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
in this line lo_view ?= wd_this->wd_get_api( ). you are taking reference of view where you have menu item. so in component controller we can't create any UI so while proceeding next line it can give u an error.. so this can be the reason for error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Obviously you will get the type conflict error because wd_this->wd_get_api( ) in component controller returns the component controller api which is not of type if_wd_view.
If you want to convert it to component controller method and call in your view, get the view reference in view and pass this reference as an exporting parameter to the component controller method.
Hope this helps u.,
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.