on 06-19-2008 4:28 PM
Hi experts,
I need to insert an Image into a Table.
In my WD component, I have a Table. I have to evaluate the content of one fields, and depending on it, I have to put into another field the following images:
-CREATE_TEXT
-CHANGE_TEXT
-CHANGE
Do anybody suggest how can I do it?
Thanks in Advance!
Kind regards,
Lucas
Hi Lucas
Right click on the table control in the layout select create binding
and select the image as the cell editor of table column and bind the property as source.
now in wdmodify you can read the context and based on the value of desired cell you can set th icon name to the context using set attribute.
in my case i am just seeting the value here name is bound to the image property. so i am passing icon names as values.
you can pass these values based on your condition.
data wa_node type wd_this->element_node.
data it_node type wd_this->elements_node.
* navigate from <CONTEXT> to <NODE> via lead selection
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
* get element via lead selection
lo_el_node = lo_nd_node->get_element( ).
* get all declared attributes
wa_node-name = 'ICON_DISPLAY'.
wa_node-address = 'test'.
append wa_node to it_node.
wa_node-name = 'ICON_CHANGE'.
wa_node-address = 'test1'.
append wa_node to it_node.
lo_nd_node->bind_table(
exporting
new_items = it_node ).
Regards
Naresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In the context node that is bound to your table, declare an additional attribute 'IMAGE_SOURCE', of type string. There has to be one column in your table which will display the actual image, bind the 'source' property of this column to the IMAGE_SOURCE attribute.
Loop through your internal table, and based on the condition, set the value of the attribute, as below:
loop at itab into wa.
if cond 1.
wa-image_source = 'CREATE_TEXT'.
elseif cond 2.
wa-image_source = 'CHANGE_TEXT'.
elseif cond3.
wa-image_source = 'CHANGE'.
endif.
modify itab from wa.
endloop.
Depending on the value in the attribute, the corresponding image will be set.
Regards,
Nithya
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 | |
9 | |
7 | |
7 | |
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.