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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Is-there-an-ajax-WizardButton-to-use-in-a-wizard-inside-a-ModalWindow--tp15978434p19894836.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]