cancel
Showing results for 
Search instead for 
Did you mean: 

Data is not passing from one custom component to another during navigation

Former Member
0 Kudos

Hi all,

           I created 2 custom components 'A' and 'B'. In 'A' I created table view with value node( table type i.e zbptable). I am fetching data

           and displaying it on 'A' Component's view. My requirement is when button say 'Goto' is clicked on 'A' Component view ,then the same

           record(data) should be displayed in the 'B' Component view. In 'B' also I created table view with the context node( this structure is same as

           that of the A component context node). In 'A' , I created outbound plung in view, window and navigation links. In the runtime repository

           I did all the required steps like creating component usage for 'B', assigning view to window etc. I followed all the steps defined in the

           navigation blog created in forums. I binded the context nodes of both the components in WD_USAGE_INITIALIZE.

           Problem is data is not getting transferred to the 'B' Component. I am able to navigate to 'B' component when the button is pressed

           but getting only empty view displayed without data in the table view of 'B' Component. Iam able to debug everything. But when the control goes

           to 'B' there is no data coming there in 'B' Can any one let me know if I am missing anything.

           is the blog I followed and created all the steps. Your help is highly appreciated.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

dharmakasi
Active Contributor
0 Kudos

Hi,

Have you bind your component A and component B context nodes in WD_USAGE_INITIALIZE in componet A component controller.

example code:

Case iv_usage_name.

when 'your componet usage name'

     iv_usage->bind_context_node( iv_controller_type  = cl_bsp_wd_controller=>co_type_component

                                    iv_target_node_name = 'IMAGENAVIGATION' "this one is current componet node

                                    iv_node_2_bind      = 'IMAGENAVIGATION' ). " target componet context node name


Best Regards,

Dharmakasi.

Former Member
0 Kudos

Hi Dharmakasi and Faisal,

                                            As I said, I did create everything. Let me explain the scenario. In the 'A' component, I have create viewset( search and result view). In search view, I am searching for data , say example like Business Partner and displaying it in result view. Result view is table view with context node say like context 'A'. I binded this context node 'A' with custom controller's context node.

Now this in this Custom Controller I binded context node 'A' with component controller's context node 'A'.

Now in WD_USAGE_INITIALIZE i included the below code.

TRY.

       CASE iv_usage->usage_name.

         WHEN 'BPMAIN'.

* Call method DO_CONTEXT_NODE_BINDING of the embedded component

           TRY.

               CALL METHOD iv_usage->bind_context_node

                 EXPORTING

                   iv_controller_type  = cl_bsp_wd_controller=>co_type_component

*                  iv_name             = 'BPMAIN'

                   iv_target_node_name = 'RESULTNODE'  " This is current component

                   iv_node_2_bind      = 'BPDETAILSNODE'. " This is 'B' compnent. This structure is same

                                                                                  " as RESULTNODE( Component A)

             CATCH cx_bsp_wd_incorrect_implement.

           ENDTRY.

       ENDCASE.

     CATCH cx_roo

In the 'B' component I created inbound plugs for window and view. From window inbound plug I am calling view inbound plug. In view inbound plug I am setting the value to the context node using collection object like below.Here I binded both view and component controller context nodes.

   me->typed_context->bpdetailsnode->collection_wrapper->set_collection( lr_col ).


As I said, I did all the navigation steps and am able to debug to the next component 'B' from 'A' but data is not coming..


Thanks.

Former Member
0 Kudos

Hi,

        Do I need to pass collection also in the window outbound plug of component 'A'. Below is my code in window outbound plug. I am not passing any data in the collection since the views and component controllers context nodes of 'A' are binded and component controllers context nodes of both 'A' and 'B' are binded in WD_USAGE_INIITIALIZE() Methods.

        me->view_manager->navigate( source_rep_view = me->rep_view

                               outbound_plug = 'GotoBPDetails').


Thanks,

Baasanthi.

dharmakasi
Active Contributor
0 Kudos

Hi Baasanthi,

Check in A component windoe outbound plug whether the context node collection is filled or not

In view inbound plug how you are getting the values into lr_col, are you able to see the data in lr_col collections in debug mode?

You are setting this collection to BPDETAILSNODE right, Both Result node and DPDETAILSNODE are same type or you fetching details from result node and assigning filling the collection?

Best Regards,

Dharmakasi.

faisal_pc
Active Contributor
0 Kudos

Hi Baasanthi,

Have you created the context node in the component controller?.

Thanks,

Faisal