on 01-09-2007 2:33 AM
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 <a href="http://www.yahoo.com">YAHOO.COM</a>"<BR><BR><BR>
how do i make the link work?
Message was edited by:
Prashant Jain
without creating event in formatted tag you cannot do this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.