Hi Brian,

The feature I have mentioned is implemented in 1.5.3 (*1).
But Stripes' wizard itself is a simple mechanism to carry request
parameters over between pages and doesn't populate form elements for
your domain object automatically.

My recommendation is to pre-populate the 'user' object before each
event as described in the 'Best Practice' page.
Please see the usage of @Before method in my post you had found.
You will need a hidden form element which holds the id of a user on
each page for the pre-population.

--
*1) Related tickets:
http://www.stripesframework.org/jira/browse/STS-647
http://www.stripesframework.org/jira/browse/STS-726

Hope this helps,
Iwao

on 10/04/21 3:59 brian.mcswee...@gmail.com said the following:
> 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