on 08-30-2012 11:33 AM
Hi everyone,
can any one help me,how to display hyperlink in the formatted text edit.and when you click on it ,should navigate to other window..
Suppose if you specify 'Http://www.google.com' then it should navigate to google page.
Thanks&Regards,
Vasavi.
Hi Vasavi,
if your Formatted Text View contains ie. "This is the link to <a href="http://www.google.com">Google</a>" and has an On Action event, you can open a new window with the link by using the following code:
METHOD onactioncallurl .
DATA: api_component TYPE REF TO if_wd_component,
window_manager TYPE REF TO if_wd_window_manager,
window TYPE REF TO if_wd_window.
DATA lv_href TYPE string.
FIELD-SYMBOLS <ls_parameter> TYPE wdr_event_parameter.
FIELD-SYMBOLS <lv_href> TYPE string.
READ TABLE wdevent->parameters
ASSIGNING <ls_parameter>
WITH TABLE KEY
name = 'HREF'.
CHECK sy-subrc = 0.
ASSIGN <ls_parameter>-value->* TO <lv_href>.
api_component = wd_comp_controller->wd_get_api( ).
window_manager = api_component->get_window_manager( ).
window = window_manager->create_external_window(
url = <lv_href> ).
window->open( ).
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Should work with standard HTML:
This is the Imgage-Link: <a href="http://www.google.com"><img src="https://www.google.de/intl/en_ALL/images/srpr/logo11w.png" /></a>
vasavi..
there is no such feasibility till now to insert any Links inside Formatted Text View / Edit..
you may achieve your requirement like below..
Where the file is stored? SAP servers or any others?
You find the document name using FIND keyword..
Let file name is : Refer this document - document.doc / document.docx and continue (this is your formatted text edit value)
now read the attribute value, then
FIND '.doc' in <lv_format_text>.
if sy-subrc is not initial.
FIND '.docx' in <lv_format_text>.
if sy-subrc is not initial.
set URL to Blank.
else.
set URL/link to given URL.
else.
set URL/ link to given URL.
endif.
Now. Insert LinkToURL / FileDownload UI element Above/Next to FormattedTextEdit/View..
Hope you understood.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To open a window code is follows. You can write it on click of link. but why do you need this linktoaction on Textedit, Keep it below no!
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.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW
EXPORTING
URL = 'http://www.google.co.in/'
MODAL = ABAP_FALSE
HAS_MENUBAR = ABAP_TRUE
IS_RESIZABLE = ABAP_TRUE
HAS_SCROLLBARS = ABAP_TRUE
HAS_STATUSBAR = ABAP_TRUE
HAS_TOOLBAR = ABAP_TRUE
HAS_LOCATION = ABAP_TRUE
RECEIVING
WINDOW = lo_window.
lo_window->open( ).
Thanks
Abhishek
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.