on 06-11-2007 7:51 AM
I'm currently working with popups in Web dynpro ABAP. When creating and opening a popup, we can register an action in the main window, when a certain botton in the popup are clicked, the action in the main window can be performed. But It looks I can only register action for predefined button like OK, Yes, NO..., or register on close action. When I tried to create my own button from web dynpro, I can not findout how to register an action in the main window which is corresponding to this button click.
Is there any experts who can help me with this block? Thank you very much
Get a reference to your window manager, and create a window object as a popup window. For this, use the method window_manager->create_popup_to_confirm that would return a reference to if_wd_window.
You then need to call the method window->subscribe to button event for each button you wish to have. If you have a yes/no/cancel, subscribe to button event thrice, passing the action as "yes", "no", "cancel" etc. These actions need to be defined separately in the "Actions" tab of your view. The event handlers will be created automatically. After defining the actions, call the method window->open to display your popup window.
Hope this helps.
Regards,
Nithya
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 answer.
Now I have my own button which is a standard abap web dynpro button, how
can I register an main window action for this button? becasue this button is not of type
window popup button. I can find no function to register an event for it.
I can only trigger window->close when the button is clicked, but the action in the main window can not be performed.
Hi
Right now in the IF_WD_WINDOW->SUBSCRIBE_TO_BUTTON_EVENT method , the button should of the type WDR_POPUP_BUTTON and it has a value list now.Which means you cannot use your own value for the time being.May be they will be coming up with an enhancement in the future.So till that time, i dont think you will be able to use your own buttons.
Thanks and regards
Anzy
Award points if this answers your question
Hi,
If you are talking about registering an action for a normal button, go to the properties tab of your button element. You would see a field "On Action". You can create your own event there. This will be called when you click the button, and the event handler onaction<event name> method will be generated. Do your processing there.
Regards,
Nithya
If the popup you mean is just a modal dialog like a prompt for save or seomthing, then it will be in the same window as your main view. You will create a window object and call it in the modal format. It will not be a new view.
But I think you are talking about displaying a view as a popup. In that case, I do not think you can trigger an event in your main view from the popup view. Please explain your requirement a bit.
Regards,
Nithya
Hi Anzy,
I have the same problem as the OP:
I want to call a popup, which has some input fields and some custom buttons (not only the standard popup buttons). On clicking on one of the custom buttons I would like to close the popup window, i.e., going back to the main screen and - now the difficult part starts - navigate to another screen. This means I would need to fire an outbound plug from the main view.
So far the popup is in another view containing the input fields and buttons. It is created from the main view via create_window - calling a new WD wnidow with the popup view as the default view. In the do init of the popup view I can also register standard button events calling action methods in the main view. This means I can fire a outbound plug from the main view when clicking on one of the standard buttons.
But how to proceed with the custom buttons? The action is processed in the popup view / popup window. How to fire an action on the main view? You write that the popup action is part of the main view. Well, true for the standard buttons. But the custom buttons are processed in the popup view / popup window, arent't they?
Thans for any help
Lars
If this helps.
declare Component Controller Usage in the VIew which is on the pop up window
Declare a Action to the Custom button on the View in the Pop up Window to be handled in the Same View (not MainView ),
Now in the Action Handler, in the Pop up View, you can call a method of the Component Controller since u have declared a usage of it in the View Properties.
From this method of Component Controller , Raise an interface Event say EventA
Declare a EVent Handler in the Main View to catch EventA A and fire Outtbound plug from there ...
SO navigation is
Button on Pop up pressed -> Action handler in the View Pop up->Call method in Component Controller-> Event raised in Component Controller->EVent caught in Main View->Outbound plug fired
See if this works
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.