on 12-11-2009 6:52 AM
Hello,
I want to use the Web UI in order to open an external URL.
I know it can be done easily using JavaScript, but the URL is generated from one of the page controller methods, and I want to open it directly from there.
I know that there's the Window Manager in the Component Controller, that can open popup windows, but none of it's methods receive an external URL.
So how can I open an external URL from the Web UI methods?
Thanks,
Udi.
Hi Udi,
Yes you can implement javascript call in the button.
How to do that :
Redefine METHOD if_bsp_wd_toolbar_callback~get_buttons.
ls_button-text = 'xxxx'.
lv_javascript = 'javascript:window.open("'.
CONCATENATE lv_javascript lv_url INTO lv_javascript.
CONCATENATE lv_javascript '","","resizable=yes,width=1025,height=500,scrollbars=yes,location=no,menubar=no,toolbar=no,location=no,directories=yes,dependent=yes,status=no")' INTO lv_javascript.
ls_button-on_client_click = lv_javascript.
ls_button-page_id = me->component_id.
lls_button-enabled = abap_true.
APPEND ls_button TO rt_buttons.
Hope it's help,
Lina
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use Transaction Launcher to open external URL.
Please find the link to configure TL http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0da6d63-8485-2c10-dab6-bb202e209455
Regards
Vinod
Hi,
you can use the Trnsaction launcher with OP.
in the window you create an OP_X
with the code
data: lv_navigation type ref to if_crm_ui_navigation_service.
lv_navigation = cl_crm_ui_navigation_service=>get_instance( me ).
lv_navigation->navigate( iv_link_id = 'ZTO_X' ). "runtime you create the TO_X nevigation"
in your implamentation class of the view you add a preotected method OP_TO_X with the code
data:
lr_window type ref to cl_bsp_wd_window.
lr_window = me->view_manager->get_window_controller( ).
lr_window->call_outbound_plug( iv_outbound_plug = 'TO_X'
iv_data_collection = iv_data_collection ).
and you call to that method from the EVENT_HANDLER you want.
Amit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for replying.
Lina, your solution is fine, but the only problem is that the URL is generated from the button's onClick event, and the JS code executes before that.
I'll check deeper into the Transaction Launcher.
Thank you both.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.