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]

Reply via email to