on 09-06-2010 3:06 PM
Hi all,
how can i define buttons in an method of an componentcontroller ?
lr_api_comp_controller = wd_this->wd_get_api( ).
lr_window_manager = lr_api_comp_controller->get_window_manager( ).
* POPUP Window vorbereiten
lr_popup = lr_window_manager->create_window(
modal = abap_true
window_name = 'W_SAVE'
title = 'Speichern der geänderten Daten'
close_button = abap_true
button_kind = if_wd_window=>co_buttons_okcancel
message_type = if_wd_window=>co_msg_type_question
close_in_any_case = abap_true ).
* Buttons definieren und deren Aktionen
lr_view_controller = wd_this->wd_get_api( ). "Here is the Problem
imp_view_controller = wd_this->wd_get_api( ).
lr_popup->subscribe_to_button_event(
button = if_wd_window=>co_button_ok
button_text = 'Seichern'
action_name = 'CHANGES_YES'
action_view = lr_view_controller ).
lr_popup->subscribe_to_button_event(
button = if_wd_window=>co_button_cancel
button_text = 'Nicht speichern'
action_name = 'CHANGES_NO'
action_view = lr_view_controller ).
* POPUP Window aufrufen
lr_popup->open( ).
Errormessage:
The result of the functional method isn't possible to convert to the type to LR_VIEW_CONTROLLER.
Other method "CREATE_POPUP_TO_CONFIRM" throws the same error.
Any idea ?
Thanks in avance.
--Bernd
Edited by: Bernward Henkel on Sep 6, 2010 4:07 PM
Hi Bernd,
Are you trying to access the view of the component ?
Could you please elaborate what would you like to achieve as a end result.
Anurag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anurag,
i want to save changed data in a method of a the componentcontroller, because i called these method from different methods of different views.
In the methos of the componentcontroller i want to create a window to show all changed data. That works, but i cant' define the button-action for that new created window.
In the button-action of the new window i want to save the data which are stored in the context of the componentcontroller.
Hope that sound's a little bit clearer.
--Bernd
Edited by: Bernward Henkel on Sep 6, 2010 5:20 PM
Hi Bernd,
wd_this->wd_get_api( ). this statement would give you reference to component not the view.
take a variable of TYPE REF TO if_wd_component.
I believe, you have called a window with a view inside it, you have used the ui elements in the view to show the changes to the use and you have not used buttons explicitly in the samw view rather you have used the buttons on the windows.
Anurag
Edited by: Anurag Chopra on Sep 6, 2010 9:35 PM
HI,
As you are creating a window pop up you will always have an option top create buttons in the view embded in the window which is used for pop up.
Instead of standard buttons use the buttons created by you in the vie. Remove the standard buttons.
To rmove the standard buttons :
pass button_kind = if wd_window=>CO_BUTTONS_NONE in the create window method
on the buttons palced in you view write the code such that you call the component controller methods to update the data.
If you do it in the way in thaty case no need to subscribe to the button events.
Regards,
Madhu
Edited by: madhu reddy on Sep 7, 2010 10:52 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.