Hi guys,

I'm new to stripes and I'm trying to do what should be super easy. I'm trying to use a multipage wizard to edit an existing object. This must be a pretty regular pattern. I've tried using startEvent and saving the user that is retrieved from the database as follows. However the values of "user" don't get persisted between steps in the wizard...i've searched at length on the forums and found another
relevant entry that was never answered....

http://www.mail-archive.com/stripes-users@lists.sourceforge.net/msg02020.html

this should be simple surely, I'm new to stripes and want to give it a proper go...but already not being able to do this is worrying...

thanks for any help, my code is below

brian

@Wizard(startEvents="begin")
@UrlBinding("/register")
public class RegisterActionBean extends BaseActionBean {

protected final Log log = LogFactory.getLog(getClass());
private UserManager um;

/** Setter to allow the UserManager to be injected. */
@SpringBean
protected void setUserManager(UserManager um) {
this.um = um;
}

@ValidateNestedProperties({
@Validate(field="password", required=true, minlength=5,maxlength=20,expression="${this eq confirmPassword}")
})
private User user;
private String confirmPassword;

/* Getters and setters for user and confirmPassword */
@DontValidate
@DefaultHandler
public Resolution begin() {
// for the moment just get one user from the database
User user = (User)um.getUser("123");
this.setUser(user);
return new ForwardResolution("/WEB-INF/jsps/edit1.jsp");

}

public Resolution gotoStep2() throws Exception {
// do some more logic here if necessary
return new ForwardResolution("/WEB-INF/jsps/edit2.jsp");
}

public Resolution gotoStep3() throws Exception {
// do some more logic here if necessary
um.save(user);
return new ForwardResolution("/WEB-INF/jsps/editsuccess.jsp");
}
------------------------------------------------------------------------------
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to