Skip to Content
0
Former Member
Apr 16, 2010 at 04:45 PM

reading attribute values from a dynamically created node

43 Views

hi experts,

i have created a node CHECKBOX with no attributes in it. i did not add any attributes. in wdmodify method, i have used add_attribute() method of if_wd_context_node_info to add attributes. all the attributes are of type string. the number of attributes changes each time based on some logic

now i need to read the values of the attributes in another method using code wizard. code wizard generated the below code

DATA lo_nd_checkbox TYPE REF TO if_wd_context_node.

DATA lo_el_checkbox TYPE REF TO if_wd_context_element.

DATA ls_checkbox TYPE wd_this->element_checkbox.

  • navigate from <CONTEXT> to <CHECKBOX> via lead selection

lo_nd_checkbox = wd_context->get_child_node( name = wd_this->wdctx_checkbox ).

  • get element via lead selection

lo_el_checkbox = lo_nd_checkbox->get_element( ).

  • get all declared attributes

lo_el_checkbox->get_static_attributes(

IMPORTING

static_attributes = ls_checkbox ).

this is giving me a synntax error saying "Type "ELEMENT_CHECKBOX" is unknown". the error is coming because attributes are created dynamically. how do i access the values of the attributes ?

thanks