Skip to Content
avatar image
Former Member

Context binding error in Dynamic UI element creation

Hi,

I am new to Webdynpro. I am trying to build an app for dynamic table data in an ALV,so creating an input field for table name dynamically.

I am facing a issue while binding the dynamic input field to the dynamically created context node attribute. The error description is: ERROR: Error in INPUT_FIELD "IF" of view "ZVK_DYNAMIC1.MAIN": Context binding of property VALUE cannot be resolved: The MAIN.1.INPUT node does not contain any elements (termination: RABAX_STATE).


Following is the code written in wdinit( ) method and wdmodifyview( ) method of the view controller.

METHOD wddoinit .

   DATA: lr_root_node_info  TYPE REF TO if_wd_context_node_info.

   DATA: lr_input_node_info TYPE REF TO if_wd_context_node_info.

   DATA: ls_attribute_info  TYPE wdr_context_attribute_info.

   lr_root_node_info = wd_context->get_node_info( ).  " get the root node

   CALL METHOD lr_root_node_info->add_new_child_node

     EXPORTING

       name                         = 'INPUT'

       is_multiple                  = abap_false

       is_multiple_selection        = abap_false

*      is_initialize_lead_selection = abap_false

     RECEIVING

       child_node_info              = lr_input_node_info.

   CLEAR ls_attribute_info.

   ls_attribute_info-name          = 'TABLE_NAME'.

   ls_attribute_info-type_name     = 'STRING'.

   CALL METHOD lr_input_node_info->add_attribute

     EXPORTING

       attribute_info = ls_attribute_info.


ENDMETHOD.


METHOD wddomodifyview .

   DATA: lr_ui_root     TYPE REF TO if_wd_view_element.

   DATA: lr_container   TYPE REF TO cl_wd_uielement_container.

   DATA: lr_input_field TYPE REF TO cl_wd_input_field.

   DATA: lr_flow_data   TYPE REF TO cl_wd_flow_data.

   IF first_time EQ 'X'.

     lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).

     CALL METHOD cl_wd_input_field=>new_input_field

       EXPORTING

*       activate_access_key        =

*       alignment  = E_ALIGNMENT-AUTO

*       bind_alignment             =

*       bind_display_as_text       =

*       bind_display_only          =

*       bind_enabled               =

*       bind_ime_mode              =

*       bind_input_prompt          =

*       bind_length                =

*       bind_password_field        =

*       bind_read_only             =

*       bind_state =

*       bind_style_class_name      =

*       bind_suggest_filter_method =

*       bind_suggest_values        =

*       bind_suppress_value_help   =

*       bind_text_direction        =

*       bind_tooltip               =

         bind_value = 'INPUT.TABLE_NAME'

*       bind_visible               =

*       bind_width =

*       context_menu_behaviour     = E_CONTEXT_MENU_BEHAVIOUR-INHERIT

*       context_menu_id            =

*       date_picker_reference_id   =

*       display_as_text            =

*       display_only               =

*       enabled    = 'X'

*       explanation                =

         id         = 'IF'

*       ime_mode   = E_IME_MODE-AUTO

*       input_prompt               =

*       length     = '20'

*       multi_field_suggest        =

*       no_history =

*       on_enter   =

*       on_table_paste             =

*       password_field             =

*       read_only  =

*       state      = E_STATE-NORMAL

*       style_class_name           =

*       suggest_filter_method      =

*       suggest_values             =

*       suppress_value_help        =

*       text_direction             = E_TEXT_DIRECTION-INHERIT

*       tooltip    =

*       view       =

*       visible    = E_VISIBLE-VISIBLE

*       width      =

       RECEIVING

         control    = lr_input_field.

     CALL METHOD cl_wd_flow_data=>new_flow_data

       EXPORTING

*       cell_design = E_CELL_DESIGN-PADLESS

         element = lr_input_field

*       id      =

*       v_gutter    = E_V_GUTTER-NONE

       RECEIVING

         control = lr_flow_data.

*

     CALL METHOD lr_input_field->set_layout_data

       EXPORTING

         the_layout_data = lr_flow_data.

     CALL METHOD lr_container->add_child

       EXPORTING

*       index     =

         the_child = lr_input_field.

   ENDIF.

ENDMETHOD.


Please help.


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 22, 2014 at 07:03 AM

    Hi,

    Check the cardinality of the node INPUT. seems you have given 1..n/1..n . use 0..n cardinality.

    Regards,

    Kiran

    Add comment
    10|10000 characters needed characters exceeded