Re: Modal inside a WizardStep

2009-10-09 Thread Jeremy Thomerson
Some very brief pseudo code.  Let us know if you need more detail.

public MyWizard(IModelFoo model) {
setModel(new ModelFoo(model.getObject());
 initialize wizard steps - passing them this.getModel() so they all use
the same model 
}

make sure to pass all of your wizard steps AND the form inside your modal
the same model.

Then, in your wizard step and form, use property models (or a compound
property model):

new MyStep(IModelFoo model) {
setModel(model);
add(new Label(firstName, new PropertyModel(model, firstName));
.. or ..
setModel(new CompoundPropertyModel(model));
add(new Label(firstName);
}


new MyForm(IModelFoo model) {
setModel(model);
add(new TextField(firstName, new PropertyModel(model, firstName));
.. or ..
setModel(new CompoundPropertyModel(model));
add(new TextField(firstName);
}

By doing this, your modal form will actually update the object that is also
backing the wizard.  Then, you should just be able to submit the form, close
the modal, and add the wizard step components to the ajax request (so that
they will be repainted). When they are repainted, they will pull the values
from the model object, which was updated by your form.

If you hit a wall with that, you *may* have to set the model on your wizard
step to the model from your form.  For instance:

// in your ajax submit:
MyStep.this.setModel(form.getModel())
target.addComponent(MyStep.this.panelThatShowsYourStuff)
// close modal

--
Jeremy Thomerson
http://www.wickettraining.com



On Fri, Oct 9, 2009 at 11:24 AM, Jeffrey Schneller 
jeffrey.schnel...@envisa.com wrote:

 I have a modal inside a wizard step.  The modal is displaying and
 showing data.  The modal is using a panel and not a page.  The panel for
 the modal contains a form with text fields.  The wizard step contains
 labels.



 I want to have a save and a cancel button in the modal.  The save should
 take the values from the text fields and update the model in the wizard
 step.  The wizard step should now show the updated values in the label.



 I tried implementing an AjaxButton in the panel for the modal but it
 never does anything.



 How would one do this?  Example code, pseudo-code?



 Thanks.






Re: Modal inside a WizardStep

2009-10-09 Thread Jeremy Thomerson
I keep wondering, too, what you are doing in the wizard that needs an
editing modal popup.  Typically, wizards are used for multi-step forms.  So
to me it's weird to have a wizard that isn't the form - but displays values
that you are then editing from a modal.  Just curious

--
Jeremy Thomerson
http://www.wickettraining.com



On Fri, Oct 9, 2009 at 11:35 AM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 Some very brief pseudo code.  Let us know if you need more detail.

 public MyWizard(IModelFoo model) {
 setModel(new ModelFoo(model.getObject());
  initialize wizard steps - passing them this.getModel() so they all use
 the same model 
 }

 make sure to pass all of your wizard steps AND the form inside your modal
 the same model.

 Then, in your wizard step and form, use property models (or a compound
 property model):

 new MyStep(IModelFoo model) {
 setModel(model);
 add(new Label(firstName, new PropertyModel(model, firstName));
 .. or ..
 setModel(new CompoundPropertyModel(model));
 add(new Label(firstName);
 }


 new MyForm(IModelFoo model) {
 setModel(model);
 add(new TextField(firstName, new PropertyModel(model, firstName));
 .. or ..
 setModel(new CompoundPropertyModel(model));
 add(new TextField(firstName);
 }

 By doing this, your modal form will actually update the object that is also
 backing the wizard.  Then, you should just be able to submit the form, close
 the modal, and add the wizard step components to the ajax request (so that
 they will be repainted). When they are repainted, they will pull the values
 from the model object, which was updated by your form.

 If you hit a wall with that, you *may* have to set the model on your wizard
 step to the model from your form.  For instance:

 // in your ajax submit:
 MyStep.this.setModel(form.getModel())
 target.addComponent(MyStep.this.panelThatShowsYourStuff)
 // close modal

 --
 Jeremy Thomerson
 http://www.wickettraining.com




 On Fri, Oct 9, 2009 at 11:24 AM, Jeffrey Schneller 
 jeffrey.schnel...@envisa.com wrote:

 I have a modal inside a wizard step.  The modal is displaying and
 showing data.  The modal is using a panel and not a page.  The panel for
 the modal contains a form with text fields.  The wizard step contains
 labels.



 I want to have a save and a cancel button in the modal.  The save should
 take the values from the text fields and update the model in the wizard
 step.  The wizard step should now show the updated values in the label.



 I tried implementing an AjaxButton in the panel for the modal but it
 never does anything.



 How would one do this?  Example code, pseudo-code?



 Thanks.







RE: Modal inside a WizardStep

2009-10-09 Thread Jeffrey Schneller
Think of an order form.  Step 1 you enter the products you want to
order.  Step 2 based on your account it pulls up a list of billing
addresses.  In step 2 you choose your billing address and the details of
the billing address are shown in step 2 with a modify link.  The modify
link allows you to modify the information and then when done the
modified information is shown as the billing address in step 2.  Step 3
is the shipping information with the same idea as step 2.  Step 4 would
be a confirmation of everything entered.  Then 'Finish'.  

This to me is a very common way to use a wizard and modal windows.

  

-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Friday, October 09, 2009 12:37 PM
To: users@wicket.apache.org
Subject: Re: Modal inside a WizardStep

I keep wondering, too, what you are doing in the wizard that needs an
editing modal popup.  Typically, wizards are used for multi-step forms.
So
to me it's weird to have a wizard that isn't the form - but displays
values
that you are then editing from a modal.  Just curious

--
Jeremy Thomerson
http://www.wickettraining.com



On Fri, Oct 9, 2009 at 11:35 AM, Jeremy Thomerson
jer...@wickettraining.com
 wrote:

 Some very brief pseudo code.  Let us know if you need more detail.

 public MyWizard(IModelFoo model) {
 setModel(new ModelFoo(model.getObject());
  initialize wizard steps - passing them this.getModel() so they
all use
 the same model 
 }

 make sure to pass all of your wizard steps AND the form inside your
modal
 the same model.

 Then, in your wizard step and form, use property models (or a compound
 property model):

 new MyStep(IModelFoo model) {
 setModel(model);
 add(new Label(firstName, new PropertyModel(model, firstName));
 .. or ..
 setModel(new CompoundPropertyModel(model));
 add(new Label(firstName);
 }


 new MyForm(IModelFoo model) {
 setModel(model);
 add(new TextField(firstName, new PropertyModel(model, firstName));
 .. or ..
 setModel(new CompoundPropertyModel(model));
 add(new TextField(firstName);
 }

 By doing this, your modal form will actually update the object that is
also
 backing the wizard.  Then, you should just be able to submit the form,
close
 the modal, and add the wizard step components to the ajax request (so
that
 they will be repainted). When they are repainted, they will pull the
values
 from the model object, which was updated by your form.

 If you hit a wall with that, you *may* have to set the model on your
wizard
 step to the model from your form.  For instance:

 // in your ajax submit:
 MyStep.this.setModel(form.getModel())
 target.addComponent(MyStep.this.panelThatShowsYourStuff)
 // close modal

 --
 Jeremy Thomerson
 http://www.wickettraining.com




 On Fri, Oct 9, 2009 at 11:24 AM, Jeffrey Schneller 
 jeffrey.schnel...@envisa.com wrote:

 I have a modal inside a wizard step.  The modal is displaying and
 showing data.  The modal is using a panel and not a page.  The panel
for
 the modal contains a form with text fields.  The wizard step contains
 labels.



 I want to have a save and a cancel button in the modal.  The save
should
 take the values from the text fields and update the model in the
wizard
 step.  The wizard step should now show the updated values in the
label.



 I tried implementing an AjaxButton in the panel for the modal but it
 never does anything.



 How would one do this?  Example code, pseudo-code?



 Thanks.






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: Modal inside a WizardStep

2009-10-09 Thread Jeremy Thomerson
Makes sense.  I've done a similar process in the past but showed the edit forms 
within the wizard step (hidden until add/edit clicked).  But this makes sense, 
too. I'm just not a big fan of modals, preferring instead to generally show 
stuff inline on the original page.  Just depends on what your UI requirements 
are.

Jeremy Thomerson
http://www.wickettraining.com
-- sent from a wireless device


-Original Message-
From: Jeffrey Schneller jeffrey.schnel...@envisa.com
Sent: Friday, October 09, 2009 1:49 PM
To: users@wicket.apache.org
Subject: RE: Modal inside a WizardStep

Think of an order form.  Step 1 you enter the products you want to
order.  Step 2 based on your account it pulls up a list of billing
addresses.  In step 2 you choose your billing address and the details of
the billing address are shown in step 2 with a modify link.  The modify
link allows you to modify the information and then when done the
modified information is shown as the billing address in step 2.  Step 3
is the shipping information with the same idea as step 2.  Step 4 would
be a confirmation of everything entered.  Then 'Finish'.  

This to me is a very common way to use a wizard and modal windows.

  

-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Friday, October 09, 2009 12:37 PM
To: users@wicket.apache.org
Subject: Re: Modal inside a WizardStep

I keep wondering, too, what you are doing in the wizard that needs an
editing modal popup.  Typically, wizards are used for multi-step forms.
So
to me it's weird to have a wizard that isn't the form - but displays
values
that you are then editing from a modal.  Just curious

--
Jeremy Thomerson
http://www.wickettraining.com



On Fri, Oct 9, 2009 at 11:35 AM, Jeremy Thomerson
jer...@wickettraining.com
 wrote:

 Some very brief pseudo code.  Let us know if you need more detail.

 public MyWizard(IModelFoo model) {
 setModel(new ModelFoo(model.getObject());
  initialize wizard steps - passing them this.getModel() so they
all use
 the same model 
 }

 make sure to pass all of your wizard steps AND the form inside your
modal
 the same model.

 Then, in your wizard step and form, use property models (or a compound
 property model):

 new MyStep(IModelFoo model) {
 setModel(model);
 add(new Label(firstName, new PropertyModel(model, firstName));
 .. or ..
 setModel(new CompoundPropertyModel(model));
 add(new Label(firstName);
 }


 new MyForm(IModelFoo model) {
 setModel(model);
 add(new TextField(firstName, new PropertyModel(model, firstName));
 .. or ..
 setModel(new CompoundPropertyModel(model));
 add(new TextField(firstName);
 }

 By doing this, your modal form will actually update the object that is
also
 backing the wizard.  Then, you should just be able to submit the form,
close
 the modal, and add the wizard step components to the ajax request (so
that
 they will be repainted). When they are repainted, they will pull the
values
 from the model object, which was updated by your form.

 If you hit a wall with that, you *may* have to set the model on your
wizard
 step to the model from your form.  For instance:

 // in your ajax submit:
 MyStep.this.setModel(form.getModel())
 target.addComponent(MyStep.this.panelThatShowsYourStuff)
 // close modal

 --
 Jeremy Thomerson
 http://www.wickettraining.com




 On Fri, Oct 9, 2009 at 11:24 AM, Jeffrey Schneller 
 jeffrey.schnel...@envisa.com wrote:

 I have a modal inside a wizard step.  The modal is displaying and
 showing data.  The modal is using a panel and not a page.  The panel
for
 the modal contains a form with text fields.  The wizard step contains
 labels.



 I want to have a save and a cancel button in the modal.  The save
should
 take the values from the text fields and update the model in the
wizard
 step.  The wizard step should now show the updated values in the
label.



 I tried implementing an AjaxButton in the panel for the modal but it
 never does anything.



 How would one do this?  Example code, pseudo-code?



 Thanks.






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org