on 01-03-2011 7:49 AM
Hi Expert,
I have a scenario like I need to show the paragraph in one text view , so I created one attribute.And
I wrote the following code in init method ,
data lv_string type string.
lv_string =
I hearby acknowledge and confirm that I have read ,reviewed and understood the policy on personel securities investment ( the ' Policy' ) of Mapletree group of companies ( the 'company' ).
'
lo_nd->set_attribute( exporting name = 'PARAGRAPH' value = lv_string ).
so it will display like following.
I hearby acknowledge and confirm that I have read ,reviewed and understood the policy on personel securities investment ( the ' Policy' ) of Mapletree group of companies ( the 'company' ).
but in which I want to make the text ' Policy' and 'Company' only bold, like following,
I hearby acknowledge and confirm that I have read ,reviewed and understood the policy on personel securities investment ( the ' Policy' ) of Mapletree group of companies ( the 'company' ).
So , What I have to do in coding for this ...
Regards,
Sankar.M
Edited by: ManoSankar on Jan 3, 2011 8:49 AM
Hi Mano
a bit change in arun idea use Format text view not FT edit
I have tested your requirement & able to achive it
1. create a Formatted text view UI in your View
2. create a attribute with type string and bind to the text property of the Formatted text view UI
3. write the code to set the text attribute with formatting
reffer the sample code below
METHOD wddoinit .
DATA lv_string TYPE string.
DATA formatted_text TYPE string.
DATA formatted_text_obj TYPE REF TO cl_wd_formatted_text.
DATA ex TYPE REF TO cx_wd_general.
DATA element TYPE REF TO if_wd_context_element.
DATA current_controller TYPE REF TO if_wd_controller.
DATA message_manager TYPE REF TO if_wd_message_manager.
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_fromat_text TYPE wd_this->element_context-fromat_text.
lo_el_context = wd_context->get_element( ).
" use tag <strong> to make the words bold .
lv_string = 'I hearby acknowledge and confirm that I have read ,reviewed and understood the policy on personel securities investment the <strong> (Policy)</strong> of Mapletree group of companies <strong> ( the company )</strong>'.
formatted_text_obj = cl_wd_formatted_text=>create( xml_text = lv_string ).
lo_el_context->set_attribute( name = `FROMAT_TEXT` value = lv_string ).
TRY.
formatted_text_obj->validate( ).
CATCH cx_wd_general INTO ex.
* " Error in formatted text
current_controller ?= wd_this->wd_get_api( ).
message_manager = current_controller->get_message_manager( ).
element = wd_context->get_lead_selection( ).
message_manager->report_attribute_exception(
message_object = ex
element = element
attribute_name = `FROMAT_TEXT`
).
ENDTRY.
ENDMETHOD.
check out the result here [http://i55.tinypic.com/qrd8ya.jpg|http://i55.tinypic.com/qrd8ya.jpg]
Regards
Chinnaiya P
Edited by: chinnaiya pandiyan on Jan 3, 2011 4:10 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Formatted_text_edit is suitable for you.
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.
Hi
Check this Web Dynpro sample application demo_uiel_formatted_text_edit.
Go thru this [link|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/44/2772f505605447e10000000a422035/frameset.htm] it might be helpful for you.
Regards
Arun.P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I dont think taht it is possible inside a text edit.
If this is the specific requirement use text views instead of text edit. and use different text views for policy and company part
in the string.
Thanks
Sarbjeet Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.