cancel
Showing results for 
Search instead for 
Did you mean: 

Refreshing the Data from a embed view in a view container

Former Member
0 Kudos

Hi everybody

I would like to know how can I do to refresh all data from a View with a view container the problem is:

that I have a window that has a view at the same time this has a view container. The Main view brings the data of editable elements when I select one element of the main view the view container brings a list for that element (dependencies) but only the first time a choose an element loads the correct data, when I choose another one it brings the same old data and doesn't make the call for the wdDoInit() method.

The question is:

How do I force the view to refresh all the data or call again the wdDoInit() method?

Thank you for your help

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

What do you mean by refreshing the values.

If you want to refresh the view then you can write view.resetView() in the wdDoModifyView after checking some condition based on your requirement.

Regards,

Murtuza

Former Member
0 Kudos

Hi All:

Thanks for the replies. The problem actually is that I have two views: a Main one that calls a child one. The child view has a view embed in a view container. The problem is that when the Main one calls the child one, the data is fine. But after the first call, only changes the data from the child view and not the data in the view embed in the viewContainer. I tried to put the code in the wdDoInit and wdDoModifyView but is not trigged, only the first time.

I don´t know what else can I do to make this view embeded to refresh or to initiate again.

Regards

Former Member
0 Kudos

Hi,

Is this view, which is embedded from a different component???

If its part of the same component do the same code what you have done in view1. for this view too.

If its from a different component expose a method from that component to refresh this view.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Ayyapparaj:

The view is embed from a different component. Can you please tell me how can expose a method from the other component to my component. I´m nearly new in this and don´t know how to do it.

I understand that I have to refresh the view from the Interface controller of the external component, in that way I can see it in my component.

Thanks for the help

chintan_virani
Active Contributor
0 Kudos

Aida,

Lets say you have two components C1 and C2 and you want method from C1 to be available in C2 then follow these steps:-

1) Goto the Interface Controller of C1 and create a method there lets say doSomething

2) Then goto C2. There you can see Used Web Dynpro Components --> Right click Add Used Component --> Give some name say C1Comp --> Click browse and select C1 --> Click Finish.

3) Next goto Component Controller of C2 --> Properties --> Click Add and check if C1 is added. If not then select the checkbox and select OK.

4) Now goto Implementation tab of C2 and lets say wdDoInit you can write following code:-

 wdThis.wdGetC1CompInterface().doSomething();

.

Chintan

Former Member
0 Kudos

Hi Chintan:

How can I call a method from a view1 in the Interface Controller of the component C1, so I can do a method in view1 that refresh it and I can call these method in the Interface Controller and in the component C2.

Thanks for your help.

Regards

chintan_virani
Active Contributor
0 Kudos

Aida,

Do the coding in wdDoModifyView as this view is called every time your view changes.

Also invalidating the node (where you have stored the date) will help too.

Chintan