on 12-17-2008 11:41 PM
Hi friends,
I have a WD and on a button i m calling another webdynpr ona other browser.
I used --
cl_wd_utilities=>construct_wd_url(
EXPORTING
application_name = 'ZWDA4_TEST'
IMPORTING
out_absolute_url = url ).
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_window = lo_window_manager->create_external_window(
url = url
lo_window->open( ).
But on Webdynpro2, i have a button, once this button is clicked i want to close this window..
can someone tell me how to code to close an existing window.. code pls..
thanks in advance,
Niraja
Hi Niraja,
When you use the create_external_window to open your application in a new window it would be returning back the reference of this new window to you. So you will have to try figure out a way by which you can pass on this reference to your second component. (This reference passed back is of type CL_WDR_EXTERNAL_URL_WINDOW )Within the 2nd component you can just use the IF_WD_WINDOW~CLOSE method of CL_WDR_EXTERNAL_URL_WINDOW to close your 2nd application window. I couldnu2019t give it a try myself to make sure of this but just try doing it. I think that it should work for you.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Niraja,
You have two components i.e. let say P component is parent and C component is the called componet.
1) In your C component create an attribute lets say gv_window of type if_wd_window and keep it public.
2) In the C component only create an interface method with parameter of type if_wd_window. Now in the implementation of this method set the value of attribute gv_window created in step 1 to the value of parameter.
3) In the P component after opening the window, call this interface method of C component by passing the instance of window which you created.
4) Now in the C component on your button click while calling method to close the window pass the window instance as wd_comp_controller->gv_window.
And your work is done.
Regards,
Neha
Hi,
Please check this [blog.|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6687] [original link is broken] [original link is broken] [original link is broken];
I hope it can help you.
Regards,
$=====$
Are you newbie? Check this out: [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Niraja,
When you have button, You would have created an event handler for that, if not created --> Create an action(ONACTIONCLOSE) for the button 'CLOSE'.
DATA: lo_window type ref to IF_WD_WINDOW.
lo_window must be global attribute and the reference variable which is used to open the window, same should be used to close the window.
Write this code in the ONACTIONCLOSE event handler.
lo_window->close( ).
then the window will be closed automatically.
Thanks,
Bharath.K
Hi Niraja,
As i understand, you are opening the window which is located in the other WD component2 by calling from the WD component1.
IF this is right?
Then Create a Interface method in the WD2 and call this method from the WD1.
In the interface method(WD2), open the window and upon clicking close button using the same reference which is used to open the window, close the window.
The mistake u r doing here is, creating a global reference in the WD1 and opening the window from WD1 itself. so don't do that.
Create a global attribute in the WD2 and make a interaction between WD1 and WD2 through interface method.
Now, it should work..try?
Thanks,
Bharath.K
Bharat,
In PCUI there is a button, if that button is clicked im writing the code above i menteioend..
that code will trigger the WD in a new browser.
Now i m in WDynpro. i have a button here, once if i hit this button, the opened new browser shud close....
its NOT from one WD to another WD.. its from PCUI to WD(new browser)....
could u pls tell me..
Niraja
User | Count |
---|---|
86 | |
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.