cancel
Showing results for 
Search instead for 
Did you mean: 

Unsuccessful Cross Component View Sharing

Former Member
0 Kudos

Hey Folks,

I am facing an issue when I am doing cross component sharing of a vew

Requirement

I need to embed View 1 of Component A into View 2 of Component B.

Solution : I have done the following steps:

In Component A:

I have a created a View 1, whose elements are bound to a node. The node has mapping to the node in the Component Controller.

I have defined an interface method in Component A which populates the Component Controller node which is bound to elements in View 1.

In Component B:

I have defined the Component A as a Used Component in Component B and have defined the Component Usage of the Interface Controller of Component A in B.

I have embedded the View1 of A into the ViewUiContainer Element in the Window corresponding to View2 of B

I have defined a method in the Component Controller of B, which makes a call to the interface method defined in A

In the wdinit method of the View2, I have created the component Usage


  l_ref_cmp_usage = wd_this->wd_cpuse_<<>>( ).
  if l_ref_cmp_usage->has_active_component( ) is initial.
    l_ref_cmp_usage->create_component( ).
  endif.

Issue

The view is showing up as desired, however no values are being populated

Analysis

On debugging, I see that the interface method is being called and the Component Controller node of A is indeed getting populated.

But then the same is not being reflected in the view.

Am I missing something here?

I need not have made the node as an interface node, since the population of the node is being done within Component A itself. Hence the only thing Component B has to do is to call the interface method with the right input parameters. But somehow the node mapping is just not happening

Any pointers on this would be of immense help.

Thanks,

Puja

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

i don't see any problem with your way of doing .

Where in component B are you calling the interface method of component A . Can you paste the code for calling the method from component B . it will help us to understand better.

Also just to make sure that mapping is correct just execute the component A and populate the component controller. and see if the component works independently.

Regards

Naresh

Answers (1)

Answers (1)

PKT
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi puja,

All the steps are fine. And, I hope, in component B's method which makes a call to the interface method defined in A, you are making a call of bind_element or bind_structure or bind_table (which ever is relevent for you) method which is must to diplay the context data in a view table?

Best Regards,

Pradeep.

Former Member
0 Kudos

Hey Folks,

Thanks for all the inputs...After a good frustrating debugging and rummaging the code for a whole day, I decided to redo the entire thing. Once I scrapped the original views, components et al and redid it over again, things seem to be working.

@Naresh : I did try doing what you have suggested and much to my surprise, it worked standalone

@Pradeep : Yes I am doing a bind_table to the node in question.

I still have a hunch that there was some kind of a problem with the binding of the ensuing table to the node. But have no clue where exactly that could have been happenign as I double checked the obvious places.

Thanks for all the inputs.

Best Regards,

Puja