on 09-26-2008 2:15 PM
Hi,
Probably a basic question but I'm trying to fill a TextEdit element with some hard-coded text (several lines). For some reason it is only showing the first line of text I coded. (in methode wddoinit).
Any help will be appreciated.
regards,
bert
Can you post the coding of your WDDOINIT that does the population of the text.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
code is:
data: textnode type ref to if_wd_context_node.
data: ls_message type ig_componentcontroller=>element_textnode.
data: lt_message type ig_componentcontroller=>elements_textnode.
textnode = wd_context->get_child_node( name = 'TEXTNODE' ).
ls_message-message = 'line 1'. append ls_message to lt_message.
ls_message-message = 'line 2'. append ls_message to lt_message.
textnode->bind_table( new_items = lt_message ).
The textedit is only showing line 1.
regards,
Bert
I think you misunderstand how a textEdit element works. It doesn't bind to an entire node using the elements as lines of the textEdit. Instead it binds to a single attribute of a single element. You should create one element of type STRING and then concatenate your text lines (separated by CL_ABAP_CHAR_UTILITIES=>CR_LF) into this one string.
Yes you're absolutely right. I interpreted the TextEdit wrong.
It works now (why didn't I ask sooner!) but between the lines there is a blank line.
Line 1
Line 2
instead of:
Line 1
Line 2
I used the code:
data: lv_string type string.
concatenate 'line 1' cl_abap_char_utitilities=>cr_lf 'line 2' into lv_string.
wd_context->set_attribute( name = 'TESTINFO' value = lv_string ).
Any ideas?
Bert
Hi,
Check your context attribute size.
If your attribue size is less than your data then you will get the output with no of characters of size of your attribute.
here i have taken attribute of type char10 but i am appending more than 10 characters so i am getting output with 10 characters.
DATA:
elem_context TYPE REF TO if_wd_context_element,
stru_context TYPE if_first=>element_context ,
item_edit LIKE stru_context-edit.
get element via lead selection
elem_context = wd_context->get_element( ).
item_edit = 'abcdefghijklmnopqrs'.
elem_context->set_attribute(
VALUE = item_edit
name = 'EDIT'
).
Edited by: suman kumar chinnam on Sep 26, 2008 3:25 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.