Re: Is there an ajax WizardButton to use in a wizard inside a ModalWindow?

2010-09-20 Thread fstof


drf wrote:
 
 in which class are call calling setOutputMarkupId(true) on the wizard ?
 

Since we are calling target.addComponent(wizard); setOUtputMarkupId should
be seton the wizard itself, since that is the component we want to
re-render.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow-tp1876283p2546806.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Is there an ajax WizardButton to use in a wizard inside a ModalWindow?

2010-09-20 Thread fstof


Sean Brookes wrote:
 
 Thank you for posting your code on this.  It is exactly the same issue I
 am working on.  A problem I am experiencing is with adding the wizard to
 the target in the addOrReplace method of AjaxWizardButtonBar:
 
 target.addComponent(wizard);
 
 That is causing the init method of the Wizard class to be called.  The
 last line of that method calls:
 
wizardModel.reset();
 
 The reset method resets the whole wizard back to it's initial state so
 when I click 'next' the navigation happens and the wizard advances to the
 next 'step' but then the wizard is reinitialized back to the original
 state.
 
 What is the best way to avoid the reset method being called?
 
 thanks in advance,
 Sean
 

init(); should not be called on target.addComponent(wizard); 
If I look at Wizard's code, init is only called on construction. 
The only reason your init may be called is if you are extending Wizard
(which I assume you are) and explicitly calling it from onBeforeRender() or
something else maybe.


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow-tp1876283p2546833.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Is there an ajax WizardButton to use in a wizard inside a ModalWindow?

2010-09-19 Thread drf

in which class are call calling setOutputMarkupId(true) on the wizard ?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow-tp1876283p2545937.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Is there an ajax WizardButton to use in a wizard inside a ModalWindow?

2009-02-18 Thread Sean Brookes

Thank you for posting your code on this.  It is exactly the same issue I am
working on.  A problem I am experiencing is with adding the wizard to the
target in the addOrReplace method of AjaxWizardButtonBar:

target.addComponent(wizard);

That is causing the init method of the Wizard class to be called.  The last
line of that method calls:

   wizardModel.reset();

The reset method resets the whole wizard back to it's initial state so when
I click 'next' the navigation happens and the wizard advances to the next
'step' but then the wizard is reinitialized back to the original state.

What is the best way to avoid the reset method being called?

thanks in advance,
Sean




fstof wrote:
 
 Incredible!
 My next and previous works perfectly, I am liking wicket more and more...
 its all so simple
 I use the same AjaxWizardButon posted above 
 
 Here is my AjaxButtonBar
 
 public class AjaxWizardButtonBar extends WizardButtonBar {
 
   private static final long serialVersionUID = 1L;
 
   public AjaxWizardButtonBar(String id, final Wizard wizard) {
   super(id, wizard);
 
   addOrReplace(new AjaxWizardButton(next, wizard, next) {
   @Override
   protected void onClick(AjaxRequestTarget target, Form 
 form) {
   IWizardModel wizardModel = getWizardModel();
   IWizardStep step = wizardModel.getActiveStep();
 
   // let the step apply any state
   step.applyState();
 
   // if the step completed after applying the 
 state, move the model
 onward
   if (step.isComplete()) {
   wizardModel.next();
   } else {
   
 error(getLocalizer().getString(org.apache.wicket.extensions.wizard.NextButton.step.did.not.complete,
 this));
   }
 
   target.addComponent(wizard);
   }
 
   public final boolean isEnabled() {
   return getWizardModel().isNextAvailable();
   }
   });
 
   addOrReplace(new AjaxWizardButton(previous, wizard, prev) {
   @Override
   protected void onClick(AjaxRequestTarget target, Form 
 form) {
   getWizardModel().previous();
   target.addComponent(wizard);
   }
 
   public final boolean isEnabled() {
   return getWizardModel().isPreviousAvailable();
   }
   });
   }
 
 }
 
 
 
 Nino.Martinez wrote:
 
 I would go checkout the source of wizardbuttonbar, find the appropriate 
 buttons and see how they either canceled or went to next step. And just 
 reimplement it with ajaxbuttons instead. It should be really trivial as 
 long as you remember target.addComponent as you mention..
 
 I guess there could be room for a Ajax wizard in extensions..
 
 fstof wrote:
 Oops... I see you are only concerned with the cancel and finish
 buttons...
 I'm looking to make everything, including the next and previous buttons
 to
 use ajax... 
 I'm asuming I'll have to have something like this in there someware,
 yes?
 target.addComponent(wizard);



 fstof wrote:
   
 Ahaa... I see...
 Can you maybe post your implementation of the onclick method of the
 AjaxNextButton?

 sorry, but I'm a bit new with the wicket thing

 Thanks a lot for the help


 AshleyAbraham wrote:
 
 Yes, I did make it to work by creating those two Ajax buttons and
 putting
 them in a class which extends WizardButtonBar class and overrided the
 newButtonBar() in the Wizard class to pass that. Its been a while
 since I
 did it, so I dont have the exact details on the tip of my finger.

 Hope it helps,
 Ashley




   
 

   
 
 -- 
 -Wicket for love
 
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow--tp15978434p22088388.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Is there an ajax WizardButton to use in a wizard inside a ModalWindow?

2008-10-09 Thread fstof

Ahaa... I see...
Can you maybe post your implementation of the onclick method of the
AjaxNextButton?

sorry, but I'm a bit new with the wicket thing

Thanks a lot for the help


AshleyAbraham wrote:
 
 Yes, I did make it to work by creating those two Ajax buttons and putting
 them in a class which extends WizardButtonBar class and overrided the
 newButtonBar() in the Wizard class to pass that. Its been a while since I
 did it, so I dont have the exact details on the tip of my finger.
 
 Hope it helps,
 Ashley
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow--tp15978434p19893571.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Is there an ajax WizardButton to use in a wizard inside a ModalWindow?

2008-10-09 Thread fstof

Oops... I see you are only concerned with the cancel and finish buttons...
I'm looking to make everything, including the next and previous buttons to
use ajax... 
I'm asuming I'll have to have something like this in there someware, yes?
target.addComponent(wizard);



fstof wrote:
 
 Ahaa... I see...
 Can you maybe post your implementation of the onclick method of the
 AjaxNextButton?
 
 sorry, but I'm a bit new with the wicket thing
 
 Thanks a lot for the help
 
 
 AshleyAbraham wrote:
 
 Yes, I did make it to work by creating those two Ajax buttons and putting
 them in a class which extends WizardButtonBar class and overrided the
 newButtonBar() in the Wizard class to pass that. Its been a while since I
 did it, so I dont have the exact details on the tip of my finger.
 
 Hope it helps,
 Ashley
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow--tp15978434p19893631.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Is there an ajax WizardButton to use in a wizard inside a ModalWindow?

2008-10-08 Thread fstof

Hey man, I'm looking for something similar,
have you got it working?


AshleyAbraham wrote:
 
 Just to clarify: I have created three classes, the parent class is the
 AjaxWizardButton similar to Wicket's WizardButton and the two child
 classes are AjaxCancelButton and AjaxFinishButton similar to Wicket's
 CancelButton and FinishButton.
 
 

-- 
View this message in context: 
http://www.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow--tp15978434p19879346.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Is there an ajax WizardButton to use in a wizard inside a ModalWindow?

2008-10-08 Thread AshleyAbraham

Yes, I did make it to work by creating those two Ajax buttons and putting
them in a class which extends WizardButtonBar class and overrided the
newButtonBar() in the Wizard class to pass that. Its been a while since I
did it, so I dont have the exact details on the tip of my finger.

Hope it helps,
Ashley


fstof wrote:
 
 Hey man, I'm looking for something similar,
 have you got it working?
 
 
 AshleyAbraham wrote:
 
 Just to clarify: I have created three classes, the parent class is the
 AjaxWizardButton similar to Wicket's WizardButton and the two child
 classes are AjaxCancelButton and AjaxFinishButton similar to Wicket's
 CancelButton and FinishButton.
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow--tp15978434p19889465.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Is there an ajax WizardButton to use in a wizard inside a ModalWindow?

2008-03-11 Thread AshleyAbraham

Hi everyone, 
I am using a Wizard inside a ModalWindow and I am trying to close the
ModalWindow when the CancelButton or FinishButton is clicked. When one of
those button's are clicked nothing happens, and I've found out that I need
to use either AjaxButton or AjaxLink to make it work. Is there an
AjaxWizardButton available to use in Wicket? basically I am looking for
AjaxCancelButton and AjaxFinishButton.

I have created my own...but I didn't want to redo something which is
available already. Please advice if there is an easy to do what I am trying
to do?

here is what I have

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.extensions.wizard.IWizard;
import org.apache.wicket.extensions.wizard.IWizardModel;
import org.apache.wicket.extensions.wizard.WizardButton;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.ResourceModel;

public abstract class AjaxWizardButton extends AjaxButton {

private static final long serialVersionUID = 1L;
private final IWizard wizard;

public AjaxWizardButton(String id, IWizard wizard, final Form form,
String labelResourceKey){
super(id, form);
this.setLabel(new ResourceModel(labelResourceKey));
this.wizard = wizard;
}

public AjaxWizardButton(String id, IWizard wizard, String
labelResourceKey)
{
this(id, wizard, null, labelResourceKey);
}

protected final IWizard getWizard()
{
return wizard;
}

protected final IWizardModel getWizardModel()
{
return getWizard().getWizardModel();
}
   
protected final void onSubmit(AjaxRequestTarget target, Form form){
onClick(target, form);
}

protected abstract void onClick(AjaxRequestTarget target, Form form);
}

Thanks
Ashley
-- 
View this message in context: 
http://www.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow--tp15978434p15978434.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Is there an ajax WizardButton to use in a wizard inside a ModalWindow?

2008-03-11 Thread AshleyAbraham



AshleyAbraham wrote:
 
 Hi everyone, 
 I am using a Wizard inside a ModalWindow and I am trying to close the
 ModalWindow when the CancelButton or FinishButton is clicked. When one of
 those button's are clicked nothing happens, and I've found out that I need
 to use either AjaxButton or AjaxLink to make it work. Is there an
 AjaxWizardButton available to use in Wicket? basically I am looking for
 AjaxCancelButton and AjaxFinishButton.
 
 I have created my own AjaxCancelButton and AjaxFinishButton...but I didn't
 want to redo something which is available already. Please advice if there
 is an easy to do what I am trying to do?
 
 here is what I have for the AjaxWizardButton
 
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.markup.html.form.AjaxButton;
 import org.apache.wicket.extensions.wizard.IWizard;
 import org.apache.wicket.extensions.wizard.IWizardModel;
 import org.apache.wicket.extensions.wizard.WizardButton;
 import org.apache.wicket.markup.html.form.Button;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.model.ResourceModel;
 
 public abstract class AjaxWizardButton extends AjaxButton {
 
   private static final long serialVersionUID = 1L;
 private final IWizard wizard;
 
 public AjaxWizardButton(String id, IWizard wizard, final Form form,
 String labelResourceKey){
 super(id, form);
 this.setLabel(new ResourceModel(labelResourceKey));
 this.wizard = wizard;
 }
 
 public AjaxWizardButton(String id, IWizard wizard, String
 labelResourceKey)
 {
 this(id, wizard, null, labelResourceKey);
 }
 
 protected final IWizard getWizard()
 {
 return wizard;
 }
 
 protected final IWizardModel getWizardModel()
 {
 return getWizard().getWizardModel();
 }

 protected final void onSubmit(AjaxRequestTarget target, Form form){
   onClick(target, form);
 }
 
 protected abstract void onClick(AjaxRequestTarget target, Form form);
 }
 
 Thanks
 Ashley
 

Just to clarify: I have created three classes, the parent class is the
AjaxWizardButton similar to Wicket's WizardButton and the two child classes
are AjaxCancelButton and AjaxFinishButton similar to Wicket's CancelButton
and FinishButton.

-- 
View this message in context: 
http://www.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow--tp15978434p15987313.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]