on 08-03-2005 1:26 PM
Hello,
I am having trouble figuring out how to cancel changes made to a record in a popup window. Here's the scenario:
- Main window has a table showing records from a user table.
- At bottom are several buttons. Two of them (Add, Edit) bring up a popup window.
- When the popup is opened as a result of the Edit button being clicked it shows the content of the selected row from the table.
- The popup has two buttons: OK & Cancel.
- The OK button should close the popup and automatically "update" the Main window's selected row.
- The Cancel button should "undo" all changes made to record and then close the popup.
I've gotten everything but the last part to work. When the Edit button on the Main window is clicked I bind the selected entry to a context element and the bind that element to the popup window. I'll be glad to provide the code if that'll help someone give me an answer.
If I click OK on the popup it just closes the window and the changes automatically are displayed in the selected row.
One option I thought of was to just save the original row element somewhere and then revert to it if Cancel is clicked. HOwever, before I go down that road I wondered if there was some built-in functionality I can take advantage of or if there was a recommended way of handling this issue.
Thanks in advance for any help.
David.
Hi ,
Only thing i see here is there should not be ant contextmapping btn "Users" node and "affectedUsers" node.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anilkumar,
There isn't. The mapping is between the "SelectedUser" controller context node and the "AffectedUser" view context node.
Looks like my solution will have to be to save the "AffectedUser" view context node as soon as the popup view is initialized. Then if the Cancel button is clicked the event handler will need to replace the view context node object with the saved object.
Thanks for your help.
I mean use different context in popup view with the same attribute syructure.Do not apply any context mapping.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anilkumar,
Sorry to be so dense but I think I need further clarification. Please remember that I'm still very much of a newbie to Web DynPro.
Here is the current scenario.
- The Main view displays a table of users.
- The AddChangeUsers view displays detail information about a specific user.
- The table on Main view is bound to a component context node called Users.
- The individual fields on the AddChangeUsers view are bound to the elements of a view context node called AffectedUser.
- When the update button on the Main view is clicked, the event handler sets another component context node (called SelectedUsers) to the appropriate row out of Users.
- The component context node SelectedUsers is context mapped to the view context node AffectedUser.
Are you saying I should NOT be doing it this way? If so, can you suggest a better way?
Would it help if I included code?
FYI - All of these context nodes are based on a model called "User". The Users node is actually a collection of User objects.
Thanks again for your help.
David.
Hi David,
Please don't do the contextmapping btwn the view and popup and use seperate context for the popup.
This is may not be perfect solution for this problem but this should solve the problem !!!
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
I guess, you have mapped your view context to the popup window's view context. And you are displaying the data in popup. Now, when you change data in popup it will also affect in original view where your table is.
But, on cancel event you want to do revert to original data, Right.
For this, you have to store that data seperately, and on action of cancel you have to set that data back. There is no standard or built-in facility for that.
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.