on 09-12-2011 6:36 PM
I have created a popup from a custom toolbar button. I created the popup window using this:
DATA lo_window_manager TYPE REF TO if_wd_window_manager.
DATA lo_api_component TYPE REF TO if_wd_component.
DATA lo_window TYPE REF TO if_wd_window.
*Call window
lo_api_component = wd_this->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_window = lo_window_manager->create_window(
window_name = 'W_PAYMENT_TENDERS'
title = 'Payments'
* close_in_any_case = abap_true
message_display_mode = if_wd_window=>co_msg_display_mode_selected
close_button = abap_true
button_kind = if_wd_window=>co_buttons_yesno
message_type = if_wd_window=>co_msg_type_none
* default_button = if_wd_window=>co_button_ok
).
I tried using the subscribe_to_button_event to change the text and actions of the yes/no buttons, but I can't figure out what to pass in the action_view. Since the popup is coming from the FPM there is no view (I don't think) that holds the popup. If I am wrong, how do I get a reference to that view? The button is created in the CNR_VIEW of FPM_OIF_COMPONENT (I might have just answered the line above, but not sure). Please clarify what the action_view is, and what I should pass it. Thanks
This seems to me an ordinary webDynpro handling.
You call this piece of code from a view right ? in that view you can create/use existing action (see tab action in the view ) to subscribe to a popup button .
if it is a simple confirmation, checkout the data loss popup available in FPM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Champion,
to handle a dialog-box in FPM you have choosen the most complicated way
(creating and opening it by yourself - also closing is standard web-dynpro then)
If it is just a confirmation-dialog, then use export-paramter eo_confirmation_request in method needs_confirmation like Baskaran mentioned.
If it is a window with content in it, the easiest way is, to use FPM-functionality to open and close the window.
See tutorials-section and FPM-handbook for further information:
[Dialog Boxes within FPM applications |http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/30d28efa-54a5-2e10-0f85-902da5c147b1]
[FPM-Handbook (starting at page 64)|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0d500f5-5205-2e10-43a6-dd023a5d0818?quicklink=index&overridelayout=true]
By the way, please read my comments to your thread "Hide button dynamically"
Best regards,
Franz
Franz,
I did see your post, thank you again. I started reading the pdf and found this:
Structure of an FPM Dialog Box
The content of FPM dialog boxes can be freestyle UIBBs or GUIBBs. The CNR and IDR
regions are not available in the FPM dialog boxes.
The button I have that I was trying to bring the pop up from is in the CNR, which I am assuming is the view of the FPM Toolbar. Thank you for all your help, please let me know if I have misread.
Michael
Hi Michael,
the advantage of working with an FPM-Dialog-Box is, that defining, opening and closing is pretty easy.
Even to find out which button was pressed when closing the window is not too difficult.
The disadvantage is, that you can only choose a button-set ("Ok", "Cancel", "Close") and as far as i know it is not possible to change the button-texts.
So if you need your own texts on the buttons, you have do it like you did.
I understood that you wanted to react different on your Yes/No-Button and you had problems assigning the relevant action.
My suggestion is:
- leave the code for opening as it is in the component-controller
but use a public attribute in the component-controller for the window-reference (lets say go_window instead of lo_window)
- define the action (MY_ACTION) in your view that is displayed in the window (lets say V_PAYMENT_TENDERS)
- use WDDOINIT of View V_PAYMENT_TENDERS to subscribe to the button-events
Coding in View V_PAYMENT_TENDERS:
METHOD wddoinit .
DATA lo_api TYPE REF TO if_wd_view_controller.
lo_api = wd_this->wd_get_api( ).
wd_comp_controller->go_window->subscribe_to_button_event(
button = if_wd_window=>co_button_yes
button_text = 'My Yes-Button-Text'
action_name = 'MY_ACTION'
action_view = lo_api
).
>>>Do the same for other buttons
In your action-handler-method you have to define an import-parameter button of type i
(the framework extracts the parameter button from wdevent for you)
method ONACTIONMY_ACTION .
CASE button.
WHEN if_wd_window=>co_button_yes.
WHEN if_wd_window=>co_button_no.
ENDCASE.
endmethod.
Best regards,
Franz
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.