cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic input field creation

former_member184741
Active Contributor
0 Kudos

hi

i have below code in wddoinit method

i am adding a node ' ITEM' and under it an attribute 'ITEM1' at runtime

lr_parent_node_info = wd_context->get_node_info( ).

lr_item_node_info = lr_parent_node_info->add_new_child_node( name = 'ITEM'

is_multiple = ABAP_FALSE

IS_MULTIPLE_SELECTION = ABAP_FALSE  ).

   attribute-name      = 'ITEM1'.

   attribute-type_name = 'STRING'.

   lr_item_node_info->add_attribute( attribute ).

i have below code in wddomodify method

i am creating a input field and binding the value property to above created attribute

i_ui_container ?= view->get_element( 'GROUP' ).

        lo_ui_element  = CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD(

          id   = 'INPUTID'

         BIND_VALUE = 'ITEM.ITEM1' ).

        cl_wd_row_head_data=>new_row_head_data( element = lo_ui_element ).

         i_ui_container->add_child( the_child = lo_ui_element ).

i a m getting the error

  • Error in INPUT_FIELD "INPUTID" of view "YTEST_01.MAIN": Context binding of property VALUE cannot be resolved: Node MAIN.1.ITEM does not contain any elements

where am i going wrong?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member206441
Contributor
0 Kudos

Hi,

Thry this link it might be helpful for you.

http://scn.sap.com/thread/595311

Thanks & Regards

Arun.K.P

former_member184741
Active Contributor
0 Kudos

hi,

My code works if i create the attribute directly under CONTEXT node. But if i create a new node dynamically  and adds an attribute it dumps.

Answers (0)