cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro component with embedded views

madan_ullasa
Contributor
0 Kudos

Hi All,

I have 3 WDA components A, B and C. The comp. A has 2 viewcontaineruielement in one of it's view. Each of these viewcontaineruielement embeds a view from component B and C. So the initial display of component A view has 2 views (one each from B and C). The view of B has an action. Now when I click on this action it displays another view from comp. B. But along with this view it is also displaying the view from comp. C which I don't need.

I want to make view from C invisible. But to do this, I am not able to access the view info either from A or B. Note that, the views are called dynamically called in A.

Any idea on how I can know that I am currently using the component B? If I know it, then I can make the view of comp. C invisible and then achieve the required result.

Regards,

Madan..

Accepted Solutions (1)

Accepted Solutions (1)

StefanRoesch
Active Participant
0 Kudos

Hi Madan,

you can achieve this by using events.

Create an event in the CC of comp. B and declare it as "Interface" Event. This event needs to be fired when your button is clicked.

In comp. A - in the view that contains the view Containers - there you can create an event handler method for this event - within this method you fire the navigation-plug to the emptyview or set the visibility of the viewcontainer to false.

i hope that helps.

regards,

Stefan.

madan_ullasa
Contributor
0 Kudos

Hi Stefan / Nishant,

Thanks for your suggestions. I tried another approach...

1. Created an interface node in component B. In a view of Comp. B where the action button exist, I capture the action info( GET_CURRENT_ACTION_INFO) in method WDDOBEFOREACTION and bind this to the interface node.

2. I used this interface node of  comp. B in comp. A for 'Simple context mapping'. In a view of comp A the view context is mapped to this interface node of comp B. And in WDDOMODIFYVIEW I am reading this context. But the context is empty with no values passed from comp. B.. All the component usages have been properly declared.

Am I doing something wrong here?  Maybe if this does not work, I may as well try Stefan's suggestion.

Regards,

Madan..

nishantbansal91
Active Contributor
0 Kudos

Hi Madan,

I think your way also work.

But if you can tried the below way. No need to define the node as an interface.

Simple thing

1. Take one class static variable.

2. Update the variable in the Component B with some value that represent that you have clicked on action of component B(That variable is accessible in all the components).

3. After updating the variable when system come into modify view method of component A put the condition in the modify view that if Class variable value = '2' hide the second VIEW UI element,


Thanks

Nishant

madan_ullasa
Contributor
0 Kudos

Hi Nishant,

Thanks again. I have achieved my requirement using interface node.

The reason I was not getting the data in the using component (A) was because my dynamic navigation parameter values were wrong.

  if_wd_view_controller->IF_WD_NAVIGATION_SERVICES_NEW~DO_DYNAMIC_NAVIGATION(

               SOURCE_WINDOW_NAME =  window name of using comp. A

               SOURCE_VUSAGE_NAME =  usage name found in window properties

               SOURCE_PLUG_NAME   =  outbound plug from the view in A

               TARGET_COMPONENT_NAME =  = Used Comp. B

               TARGET_COMPONENT_USAGE = Comp. usage name for B in A

               TARGET_VIEW_NAME   =  View name in comp. B

               TARGET_PLUG_NAME   =  Inbound plug in comp. B

               TARGET_EMBEDDING_POSITION = View in A/viewcontaineruielement name which embeds view of comp. B

Regards,

Madan

nishantbansal91
Active Contributor
0 Kudos

Hi

Thanks for sharing the answer it would be helpful for others.

Thanks

Nishant

Answers (1)

Answers (1)

nishantbansal91
Active Contributor
0 Kudos

Hi,

Do one thing you have two viewcontainer. When the first view action has triggered hide the view container, Instead of hiding the view, you can simply hide the view ui container.

You have defined the viewuielement container in component A. So when the action is triggered hide the viewuielement container.

Thanks

Nishant

madan_ullasa
Contributor
0 Kudos

Hi Nishant,

Yes, the viewcontainteruielement can also be hidden. But the issue here is, when I click on the action in the view of comp. B, I need to know that I have clicked on a button in Comp. B. Then I can hide the uielement which holds the view from the comp. C.  I am not able to capture the data which tells me that the component B is being used now. Hope you understand. The initial display will be views from both the components B and C. Later when I click on a button in the embedded view of B, it will go to next view of comp. B. At this point of time I don't want view of comp. C to be displayed. To make this view of comp. C invisible, I need to get the info that I am doing some action in view of comp. B.

Regards,

Madan.

nishantbansal91
Active Contributor
0 Kudos

Hi Madan,

Create one class, than update the static attribute of  class in the component B.

and after that modify view is called of component A then read the value than you will come to know if the button is clicked or not.

Thanks

Nishant