cancel
Showing results for 
Search instead for 
Did you mean: 

FormattedTextView and ANCHOR tag

Former Member
0 Kudos

I want to display this in the FormattedTextView control.<BR><BR>

"CLICK ON THIS LINK TO GO TO YAHOO.COM"<BR><BR>

YAHOO.COM is a link or an anchor tag and the href is pointing to "http://www.yahoo.com".<BR><BR>

The following code should achieve this ...<BR>

DATA:<BR>

lv_text2 TYPE string,<BR>

l_formatted_text1 TYPE REF TO cl_wd_formatted_text,<BR>

l_formatted_text2 TYPE REF TO cl_wd_formatted_text.<BR>

l_formatted_text1 = cl_wd_formatted_text=>make_text(<BR>

inner_text = 'CLICK ON THIS LINK TO GO TO &YAHOO_LINK&'<BR>

).<BR>

l_formatted_text2 = cl_wd_formatted_text=>make_a_tag(<BR>

href = 'http://www.yahoo.com'<BR>

inner_text = 'YAHOO.COM'<BR>

).<BR>

l_formatted_text1->replace_placeholder( name = 'YAHOO_LINK' formatted_text = l_formatted_text2 ).<BR>

TRY.<BR>

l_formatted_text1->validate( ).<BR>

lv_text2 = l_formatted_text1->m_xml_text.<BR>

CATCH cx_wd_general INTO l_error.<BR>

lv_text2 = 'ERROR'.<BR>

ENDTRY.<BR><BR>

CALL METHOD wd_context->set_attribute<BR>

EXPORTING<BR>

VALUE = lv_text2<BR>

name = 'TEXT' .<BR><BR><BR>

PROBLEM:<BR>

The word YAHOO.COM is displayed as a link ... no issues. But when I click on it, nothing happens. When I hover my mouse over it, it displays this in the status bar ... Javascript:Void(0). Which means there is no href specified. I also debugged the code and the variable lv_text2 shows the following text "CLICK ON THIS LINK TO GO TO &lt;a href="http://www.yahoo.com"&gt;YAHOO.COM&lt;/a&gt;"<BR><BR><BR>

how do i make the link work?

Message was edited by:

Prashant Jain

Accepted Solutions (0)

Answers (1)

Answers (1)

sanju_joseph
Participant
0 Kudos

without creating event in formatted tag you cannot do this

Former Member
0 Kudos

what coding ist needed in FormattedTextView.onAction Event to call the URL?