PDA

View Full Version : AbstractWizardFormController problem


aritomo_abe
Jun 5th, 2008, 11:41 AM
Hello all,

I implemented AbstractWizardFormController. All is ok now :rolleyes:
But I have one question :

e.g. I click "Add user" to create user with new data. I modify data but do not click finish button.

Then I click again on main page "Add user" and modify data for the second user and also do not click finish button.

Then I return to first user and click refresh and see that instead of my entered data for first user I see data for second user.

This is my formBackingObject function :


protected Object formBackingObject(HttpServletRequest request)
throws ServletException {
UserEditCommand retUserEditCmd = new UserEditCommand ();
try {
String userId = request.getParameter("userId");
if (userId != null) {
retUserEditCmd .setUserId((Integer.parseInt(userId)));
}
} catch (Exception ex) {
}
return retUserEditCmd ;
}


In debug mode when I try to create first user new instance of UserEditCommand is created and then used.

When I try to create second user new instance of UserEditCommand is created too and then used.

But when I switch from second user to first command object from second user is used for first. Should I implement some logic to manage different command for simultaneously opened pages or I do something wrong?


Thanks,
Aritomo