on 09-11-2007 3:40 PM
Hello,
I display a popup. After pressing a popup button (the buttons at the buttom) I do the following in WDDOMODIFYVIEW:
if_wd_window~unsubscribe_from_button_event( button = if_wd_window=>co_button_cancel ).
if_wd_window~subscribe_to_button_event(button = if_wd_window=>co_button_cancel
button_text = new_text
... )
if_wd_window~set_close_button( close_button = abap_false ).
The Problem is that the text of the button does not change and the close button does not disappear.
Best regards, Hergen
hi hergen,
the problem is that........ whenever you call a pop up window from a view,
the pop up window will be displayed, but the 'WDDOMODIFYVIEW' method of the view will be run in the background. After clicking the button in the pop up, the same thing happens again. so you have to redefine your logic to make sure that the method is called at the appropriate time.
---regards,
alex b jsutin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
I unfortunately don't understand your answer. Can you explain it in other words?
What do you mean by "run in background"?
The WDDOMODIFYVIEW method of the view is called and the button has successfully been subscribed to a new action (it works).
But why does the button text not change?
Thanks in advance and best regards, Hergen
hi hergen,
consider you are having a view 'a' and a popup window 'b'.
You click a button and the pop up window opens.
while it is opened.... the 'WDDOMODIFYVIEW' method will be called.
you complete the processing of the pop up window and click the ok button in it. so once again the 'WDDOMODIFYVIEW' method of view 'a' will be called.
so once again the text would be re initialized.
-
regards,
alex b justin
Hi Hergen,
whether you are doing this in WDOMODIFYVIEW of popup view or parent view... i hope it is pop up view only ?
Regards
Anuj Goyal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
thank you for your answers so far!
I would like to explain the issue in more detail:
1. The popup is being displayed.
2. I press a button which is at the buttom of the popup, that is, a roundtrip is started and within this roundtrip the WDDOMODIFYVIEW method is called.
In WDDOMODIFYVIEW I firstly unsubscribe und then subscribe the co_button_cancel to a different action und provide a new button text.
I could successfully test that the system executes the different action when pressing the button.
But why does the button text not change?
Hergen,
If I understood you correctly, you want to change the button text after you had the popup opened. I don't know if this is do-able. I will be very interesting to see if anyone was able to do this myself. My experience so far is that you can change the button text before the window has really appeared, ie:
-- from the parent view, subsribe the event with button text change, then open the window
-- from WDDOINIT() of the popup view
-- from WDDOMODIFYVIEW() of the popup view when the first_time is true
few things you might be able to try to see if you can get around this. First, in the action handling method, somehow to have your parent view to close and reopen the popup with the different button text. Or if you are able to find out how you can get hold of the buttons on the popupwindow then do dynamic programming in the WDDOMODIFYVIEW() of the popup view to change its text.
Good luck,
Tina Yang
Hello Tina, hello Anuj,
I am only refering to a popup which embeds one view. And I mean the WDDOMODIFYVIEW of that view.
The popup is displayed and has two buttons: OK and CANCEL.
After pressing the OK button I want so assign a different action and different text
to button CANCEL with SUBSCRIBE_TO_BUTTON_EVENT (in WDDOMODIFYVIEW). Please note that the popup is not closed in the meantime.
SUBSCRIBE_TO_BUTTON_EVENT is executed and I can see that indeed the new action is assigned to button CANCEL. But the text stays the same.
Hello, Hergen,
As I said in this thread earlier, I am not sure if you can change the button text once the window has appeared. You mentioned you can see the new actionis assigned to button CANCEL. Try this, add a if statement in the WDDOMODIFY method to check if first_time eq abap_true, assign a action, and if not, assign to another action, I don't think you will arrive to the other action.
If that is case, maybe you can tried to have the popup window closed and re-opened with the different button text.
Good luck,
Tina Yang
Hergen,
Did you create this popup window with the button_kind you are interested in before you did all these unsubscribe and subscribe to the buttons?
The right sequence would be you use the if_wd_window_manager to create a popup/confirmation popup window, in that method call, you have to specify the botton_kind, and you will get a window with the type ref to if_wd_window back. You use this window ref to open the window and you need to save it so you can use it in the WDDOINIT of the view that are used for popup to do subscribe and unsubsribe button event.
DATA: lr_component_api TYPE REF TO if_wd_component.
DATA: lr_window_manager TYPE REF TO if_wd_window_manager.
DATA: lr_window TYPE REF TO if_wd_window.
lr_component_api = WD_COMP_CONTROLLER->wd_get_api( ).
lr_window_manager = lr_component_api->get_window_manager( ).
CALL METHOD lr_window_manager->CREATE_WINDOW
EXPORTING
MODAL = ABAP_TRUE
WINDOW_NAME = 'W_POPUP' "This is name of the interface view/window you want to pop
TITLE =
CLOSE_BUTTON = ABAP_TRUE
<b>BUTTON_KIND = if_wd_window=>co_buttons_okcancel </b> " or if_wd_window=>CO_BUTTONS_CLOSE, check if_wd_window to see your options
MESSAGE_TYPE = IF_WD_WINDOW=>CO_MSG_TYPE_NONE
CLOSE_IN_ANY_CASE = ABAP_TRUE
MESSAGE_DISPLAY_MODE =
DEFAULT_BUTTON =
RECEIVING
<b>WINDOW = lr_window</b>
.
now you can use lr_window to open the window
lr_window->open( ).
and if you save this lr_window on the component controller, you can access it again in the view that was embedded in the W_POPUP window.
I would suggest you to put the subsribe and unsubsribe the button event code in the WDDOINIT of the view.
Hope this helps, if you need more info on how to correctly subsribe to the buttons in your button_kind, let me know.
Regards,
Tina Yang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.