cancel
Showing results for 
Search instead for 
Did you mean: 

Initialization of nodes everytime the view is called

Former Member
0 Kudos

Hi experts

ABOUT: I am trying out a code in which I am displaying a table in First view with 2 buttons for edit and add. If the user clicks add button, Second view is called with blank input fields and a button to save. If the user clicks edit, input field with the values in lead selection of previous view should be displayed. I am able to do this.

ISSUE: But after saving the values I want the control again to go to the First view. Where I want the table to be updated with all the new values (values just saved in second view also). I know I canu2019t put the code for initialization in DO_INIT, as it is called only once in the lifetime of view controller. When I keep the code in DO_MODIFY_VIEW everything is fine but I am not able to change the lead selection. Where exactly should I put my code for initialization? Awaiting your valuable replies.

Thanx

Gaurav

Accepted Solutions (0)

Answers (2)

Answers (2)

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi

As per my knowledge you can achieve this by triggering a event in the second ADD view with save button.

When ever you modify and save in the second view RAISE a Event so declare a method /event handler in the component controller

So that you can refresh the data/node which is associated with the First View

So you can avoid writing code in MODIFY method.

Communicate using the events in your case is more Helpful.

Regards

KALYAN

Former Member
0 Kudos

What i would suggest is to consider using the component controller for your context. Do the context mapping to view1 and view2.

When ever you select a line, lead selection is set and fire a plug to view2. View2 just displays a form with selected record.

When you ready in view 2 , fire a plug to go back to view1. You do not have to do anything, the data is already updated in view2 , lead selection is not changed in view1.

So the solution is to have the context in component controller,context mapping in views. Use plugs to navigate between views.