Skip to Content
avatar image
Former Member

Regarding Usages in Web dynpro

Hi Everyone,

I am facing some issues in passing data from the used component to the parent component.

Here is the scenario. The application is a single screen with many panels(trays with tables, not tabs). We wanted to divide the application into many components so that the develpers dont cross each other during the development phase. There is a home component that gets the initial data required for the application and creates the usages for all the panel components( the data is passed via mapping). There is a field in the home screen that needs to get updated when ever the user changes data in the panel components.

As the field(context) to be upadted is just one and many panel components are in invloved, I am looking for a way to map this field to all the panel components, so that the any changes in the panel components gets updated on the home screen field.

Example.

Home screen with details about itemized debt from five different customers(5 trays with tables).

There is a field called sum total on the main screen.

If the user changes the debt on first customer from say 10 to 50, the same should reflect on the sum total on the main screen. This should be valid for all the other four customers.

How can i map the sum total field to all the five components, so that data change in the individual components gets reflected real time on the main component.

Thanks in advance

Vinay Reddy

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 27, 2008 at 02:39 PM

    Where in this scenrio would you start a roundtrip? Does every component have its own buttons or would the buttons be placed in the main component?

    If every component was to have its own buttons, a possible solution migth be to create a central "business logic class" that is known to all child components as well as to the parent component. If data of a child component is changed, the child component would

    1. change the data in the "business logic class"

    2. raise a WD-event

    The parent component can react then react accordingly.

    Regards, Silke

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 27, 2008 at 06:40 PM

    >How can i map the sum total field to all the five components, so that data change in the individual components gets reflected real time on the main component

    Perhaps I am missing something, but there doesn't seem to be anything special about this situation. You would just model your sum total field within the master component and then map that same context node to each of the children. Any activity in the children that changes the context node will actually make the change to the parent node since that is the mapping source.

    This is very much how Floor Plan Manager applications work when using a shared data component.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks every one for the suggestions.

      Used the add_event_handler method to register a event with a listener in the home component.

      Raised the event in panel component to trigger the event handler method in the home component that would take care of the context change.

      used the following code in the home component

      DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .

      lo_componentcontroller = wd_this->get_componentcontroller_ctr( ).

      DATA lo_api_componentcontroller TYPE REF TO if_wd_component.

      lo_api_componentcontroller = lo_componentcontroller->wd_get_api( ).

      lo_cmp_usage->add_event_handler(

      listener = lo_api_componentcontroller

      handler_name = 'HNDL_DATA_SELECTED'

      controller_name = 'INTERFACECONTROLLER'

      event_name = 'EVENT_FLEX' ).

      raised the event in the panel component using

      wd_this->fire_event_flex_evt(

      ).

      Vinay Reddy