Skip to Content
avatar image
Former Member

FormattedTextView and ANCHOR tag

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

"CLICK ON THIS LINK TO GO TO YAHOO.COM"

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

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'

inner_text = 'YAHOO.COM'

).<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 <a href="http://www.yahoo.com">YAHOO.COM</a>"


how do i make the link work?

Message was edited by:

Prashant Jain

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 28, 2008 at 10:24 AM

    without creating event in formatted tag you cannot do this

    Add comment
    10|10000 characters needed characters exceeded