Component initialization in navigation
I have two views in my component: A and B.
View A is a "normal" view. Into view B I have embedded another component. The idea is that I can choose certain item in view A, and then navigate to view B, which shows me the details of the selected item.
Now this works in the following way: When I select the item in view A, I populate a certain contect node with the "key fields" of the item, deliver this node to the other component via interface node, and then in the WDDOINIT method of componen B I populate the context with the details based on the key fields in the interface node.
Now the problem is that when I navigate back to view A, and select another item, and navigate again to B, the WDDOINIT method is not triggered anymore, and because of this, I still have the old data there. (=the view is showing me the data of the item that I selected the first time).
How to handle this situation? Can I somehow kill the custom controller (now containing the context with the details) of the component in view B? Or can I call the method, that fills the context with the details, in some other phase than WDDOINIT?
Sumit Oberoi replied
In such situations where the second view's content depend on first one.
One should always code in HandleInput method (The input plug method of second view).
This will always provide u with the current data and will remove the dependence on the WDDOINIT.
Common data which is used can be declared as attributes in Component controller.
I hope it helps.
Please revert back with issuse.