I think this is something that has happened before, so I hope that someone has a solution for this problem.
In our application it's possible to open a list of users. From those users it's possible to open a profile view (with a form). It must be possible to open several tabs at the same time, in several different tabs. The problem is that if you open several tabs and you edit the first one, that data is saved on the last opened subject.
Is it possible to get around this? I was thinking of generating a unique ID (with UUID and adding an attribute to the form containing that ID. The session holds a map of user objects, with that id as identifier.
The problem is, what about binding the attributes? I mean, instead of binding it to an object, you have to bind it to an object in a map, corresponding to a specific key.
My guess is that instead of doing this:
you have to do this:Code:
Java:
ModelAndView view.add("user", user);
JSP:
<s:bind path="user.username">...</s:bind>
Am I correct on this one? I haven't tested this solution yet, I'm just brainstorming :-). If there are better solutions, feel free to post them.Code:Java:
view.add("userMap", userMap);
view.add("key", key);
JSP:
<s:bind path="userMap[key].username">...</s:bind>
