cancel
Showing results for 
Search instead for 
Did you mean: 

approach of using context for displaying and editing values in webdynpro

Former Member
0 Kudos

Hi All,

I have a scenario in webdynpro where i am getting a table with 2 columns and 10 rows , columns empname and empno from backend which is displayed in a view using the contextnode empdetails having the attributes empname and emp no.Now when on selecting the row i am displaying the values of empname and empno in the textfields using the context attributes.Now user can change these values and hit edit button which will take him to next screen showing all chnaged values where he can hit save button and call rfc to make effect of changes in backend.

So in the first screen when user clicks on any row the values are displaying in textfields and now if user changes the value in textfield does the context updates immediately and loose the original values and if from next screen if he cancels will the context be restored to original values displaying your modifications wont be saved dialog box and go back to original screen showing original values. so using the context values directly for user edit is right way or Copy the changed values in a tempnode context then in next screen when he hits save the set the original context with the temp context created in the previous screen and save it. what is the best way to do this.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kumar,

Best approach would be like .

1)Give Edit button above table.

2) if any body wants to edit let first select row of table and click on Edit button.

3) On Click of Edit button take user to second screen and give option of Save and Cancel.

4)On Save fire RFC and cance bring back to first screen.

Hope it will give some idea.

Kind Regards

Sarsij

Former Member
0 Kudos

Hi Sarsij,

When i change the values and hit next the values of the original context has changed and set with modified values ,now in next screen if user hits cancel ,the original values needs to be restored , how to acheive this.Is temporary node created with original values and use it to restore the original if cancel is hit is the best solution.

Thanks.

Former Member
0 Kudos

Hi, kumarv!

I think you should to use one node for current values, and some other node (or attribute) for original values collection.

Suppose you have Original attribute of type java.util.Collection for original values and Current model node for current (editable) values. Then restore original values with

wdContext.nodeCurrent().bind(wdContext.currentContextElement().getOriginal());

Former Member
0 Kudos

Hi Kumar,

You can follow the approach mentioned 3rd note to preserve the modifies values.

Kind Regards

Sarsij

Answers (0)