You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Leonardo D'Alimonte <le...@gmail.com> on 2020/07/15 14:14:05 UTC

Wizard - showing Modal on "next" button

Hello,

I'm writing a Wizard with some steps inside which the user must follow.
I wonder if there's the chance to display a modal window with a warning
message when the user clicks the "Next" button, in order to ask for a
confirmation.

Once the user acknowledges the message with the OK button, step can be
marked as complete and the user can go on with the following steps.

Has someone ever experienced a usage like this? Do you have any suggestion
about how to implement this additional modal window?

NextButton of the WizardButtonBar is a simple Button and so it lacks a
RequestTarget to refresh the ModalWindow, is that correct?

Thanks,
-- 
Leonardo

Re: Wizard - showing Modal on "next" button

Posted by Sven Meier <sv...@meiers.net>.
Hi,

easiest solution is to do the confirmation in JS only:

         button.add(new Behavior() {
             @Override
             public void renderHead(Component component, IHeaderResponse 
response)
             {
response.render(OnEventHeaderItem.forComponent(component, "click", 
"return confirm('Do you really want to perform this action?');"));
             }
         });

> NextButton of the WizardButtonBar is a simple Button and so it lacks a RequestTarget to refresh the ModalWindow

Yes, you can use AjaxWizardButtonBar instead, if you want to use a ModalWindow instead.
  

Have fun
Sven


On 15.07.20 16:14, Leonardo D'Alimonte wrote:
> Hello,
>
> I'm writing a Wizard with some steps inside which the user must follow.
> I wonder if there's the chance to display a modal window with a warning
> message when the user clicks the "Next" button, in order to ask for a
> confirmation.
>
> Once the user acknowledges the message with the OK button, step can be
> marked as complete and the user can go on with the following steps.
>
> Has someone ever experienced a usage like this? Do you have any suggestion
> about how to implement this additional modal window?
>
> NextButton of the WizardButtonBar is a simple Button and so it lacks a
> RequestTarget to refresh the ModalWindow, is that correct?
>
> Thanks,

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