Hi ,
we develope a tree in which we have two thing at folder level.i have to assign diffrent icon for both.for that i create a attribute at context level.and bind it from layout(source icon).and get attribute & set attribute at creatation of folder time bu it repete last one icon for evey node..like...
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_icon LIKE ls_context-icon.
get element via lead selection
lo_el_context = wd_context->get_element( ).
get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `ICON`
IMPORTING
value = lv_icon ).
data l_name type char1.
clear l_name.
l_name = folder_item-name .
if l_name EQ 'E'.
lv_icon = 'ICON_EQUIPMENT'.
lo_el_context->set_attribute(
EXPORTING
name = `ICON`
value = lv_icon ).
else.
lv_icon = 'ICON_TECHNICAL_PLACE'.
lo_el_context->set_attribute(
EXPORTING
name = `ICON`
value = lv_icon ).