chain your models manually instead of using a propertymodel, you can
achieve the same result as long as instead of keeping a reference to
the object you keep a reference to the model and retrieve the object
when needed.
-igor
On Wed, Mar 19, 2008 at 2:31 PM, smallufo <[EMAIL PROTECTED]> wrote:
> Thank you , but it seems that PropertyModel is not refactory-friendly
> Is there any better way to achieve this ?
> Thank you very much.
>
>
> 2008/3/14, Jeremy Thomerson <[EMAIL PROTECTED]>:
>
>
> >
> > Show us the code from your ConfirmStep. My guess is that you're not
> > familiar with the need for models yet. For instance, my guess would be
> that
> > you're doing this:
> >
> > public ConfirmStep(MyObj obj) {
> > add(new Label("time", obj.getTime()));
> > add(new Label("location", obj.getLocation()));
> > }
> >
> > If you are - that's the problem. Try this:
> > public ConfirmStep(MyObj obj) {
> > add(new Label("time", new PropertyModel(obj, "time")));
> > add(new Label("location", new PropertyModel(obj, "location")));
> > }
> >
> > That will fix this problem, but you need to go learn as much as you can
> > about models. You should probably also be passing an IModel into the
> > constructor of each step, as well... Not the actual object.
> >
> > Hope this helps.
> >
> > Jeremy Thomerson
> > -- sent from a wireless device
> >
> >
> > -----Original Message-----
> > From: "smallufo" <[EMAIL PROTECTED]>
> > To: [email protected]
> > Sent: 3/13/08 9:10 AM
> > Subject: [Howto] WizardStep communication ?
> >
> > This is my Wizard and steps :
> >
> > MyObj myObj = new MyObj(); // build MyObj with default Time / Location
> > WizardModel model = new WizardModel();
> > model.add(new TimeStep(myObj));
> > model.add(new LocationStep(myObj));
> > model.add(new ConfirmStep(myObj));
> > init(model);
> >
> > MyObj is just a class containing time / location data , and with default
> > value.
> > The wizard first asks user to input time , and then input location ,
> > In the third step (ConfirmStep) , it will show the data inputed , asking
> > the
> > user to confirm.
> >
> > The problem is , the ConfirmStep always shows the default value .
> > Time / Location in the 1st and 2nd Step is not shown.
> > It seems it is because that the ConfirmStep is instantiated and all values
> > are pulled at the construction time.
> >
> > Is there any way to prevent this ?
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]