Skip to Content
avatar image
Former Member

How to get the value from dynamically created input fileds?

Hello Gurus,

I am creating a pop up window dynamically which will have input fields based on the user selection from main view (main window) now i want to catch these fields to pass it on to the next view for further processing.

Please tell me how can i achieve this?

Regards,

Rahul

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 05, 2007 at 06:09 AM

    In the default inbound plug of the window which you will be launching as a popup, add parameters that will hold values of your input fields. If you do not know the data types, then you can declare them as string. Then pass the values thru the plug. Displaying the passed values in the popup view should be handled in the inbound plug handler.

    Regards

    Nithya

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rahul,

      When a showing a pop up , you will be opening a new window and will be embedding the views in the window.But the context bindings of the view can

      be still mapped to the component controller.So whatever data you have in the component controller will be passed to the new view as well.

      The following code explains how you can call a pop up with the window name.

      Hope this will be helpful.

      I have coded this in the component controller method.

      Thanks

      Anzy

      Data:l_cmp_api type ref to if_wd_component,

      l_window_manager type ref to if_wd_window_manager,

      l_comp_info type ref to IF_WD_RR_COMPONENT,

      l_final_window type ref to IF_WD_WINDOW.

      l_cmp_api = wd_this->wd_get_api( ).

      CALL METHOD L_CMP_API->GET_COMPONENT_INFO

      RECEIVING

      COMPONENT_INFO = l_comp_info

      .

      l_window_manager = l_cmp_api->get_window_manager( ).

      CALL METHOD L_WINDOW_MANAGER->CREATE_WINDOW

      EXPORTING

      • MODAL = ABAP_TRUE

      WINDOW_NAME = '<YOUR WINDOW NAME>'

      • TITLE =

      • CLOSE_BUTTON = ABAP_TRUE

      • BUTTON_KIND =

      • MESSAGE_TYPE = IF_WD_WINDOW=>CO_MSG_TYPE_NONE

      • CLOSE_IN_ANY_CASE = ABAP_TRUE

      • MESSAGE_DISPLAY_MODE =

      • DEFAULT_BUTTON =

      RECEIVING

      WINDOW = l_final_window

      .

      CALL METHOD L_FINAL_WINDOW->OPEN

      .

  • avatar image
    Former Member
    Jul 04, 2007 at 09:33 AM

    Hi Rahul, I assume you use the Window Manager to implement your popup. If so, then your popup is a window that contains view(s). You can map the view(s) elements to context nodes. So your application can "catch" these fields by simply reading them from the context nodes. This operation is done automatically (code-free) once the mapping has been done between view elements and context node attributes.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 04, 2007 at 11:03 AM

    Even though your input fields are dynamically created, you would have bound them to the context right? Just read the context and get the data.

    Regards

    Nithya

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      But consider that you have to read dynamic attribues with get_attribute because using get_static_attributes only return statically created attributes.