> Hi experts, > > I want to implement a wizard, user need to input some data, I can do it with > a single page using form, but I don't know how to do it in wizard, I put a > couple of input textfield etc. then I get a error: > > java.lang.IllegalStateException: Attempt to set model object on null model > of component: wizard:form:view:expectedNumberOfBoxes > > Note: expectedNumberOfBoxes is the first textfield I declared in the java > class, after googling a few hours(not too much information) I think I need > to setup a 'model'? but I probably need more details how... my code is like: > > public class DeliveryDetails extends WizardStep { > > > public DeliveryDetails(Delivery delivery, String title, String > content){ > super(title, content); > > RequiredTextField expectedNumberOfBoxesTextField = new > RequiredTextField("expectedNumberOfBoxes", Integer.class); > add(expectedNumberOfBoxesTextField); > > RequiredTextField receivedNumberOfBoxesTextField = new > RequiredTextField("receivedNumberOfBoxes", Integer.class); > add(receivedNumberOfBoxesTextField); > > }
Yep, you need to work with models. For instance: RequiredTextField receivedNumberOfBoxesTextField = new RequiredTextField("receivedNumberOfBoxes", Integer.class, new PropertyModel(delivery, "receivedNumberOfBoxes")); add(receivedNumberOfBoxesTextField); or: setModel(new CompoundPropertyModel(delivery)); RequiredTextField receivedNumberOfBoxesTextField = new RequiredTextField("receivedNumberOfBoxes", Integer.class); add(receivedNumberOfBoxesTextField); Eelco --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]