Browser native confirm is blocking and ugly :( Is there any option to use jquery-ui confirm?
WBR, Maxim (from mobile, sorry for the typos) On Aug 5, 2016 20:09, "Sebastien" <seb...@gmail.com> wrote: > Hi Maxim, > > Seems its a common question in the jquery-ui world... > The best I can propose you for now is something like the following code. > It does *not* use revert, but use a clone helper. > This example is also using a browser-native "confirm" dialog... > > Inspired from http://jsfiddle.net/WbHAr/1/ > > Draggable: > > Draggable<Book> draggable = new > Draggable<Book>("draggable", model) { > > @Override > public void onConfigure(JQueryBehavior behavior) > { > super.onConfigure(behavior); > > behavior.setOption("helper", "'clone'"); > } > }; > > > Droppable: > > final Droppable<Void> droppable = new Droppable<Void>("card") { > > @Override > public JQueryBehavior newWidgetBehavior(String selector) > { > return new DroppableBehavior(selector, this) { > > @Override > protected JQueryAjaxBehavior > newOnDropAjaxBehavior(IJQueryAjaxAware > source) > { > return new OnDropAjaxBehavior(source) { > @Override > public CharSequence > getCallbackFunctionBody(CallbackParameter... > parameters) > { > return String.format("if (confirm('Drop > here?')) { $(this).append(ui.draggable); %s}", > super.getCallbackFunctionBody(parameters)); > > } > }; > } > }; > } > > > Hope this helps :) > Sebastien > > On Fri, Aug 5, 2016 at 2:16 PM, Maxim Solodovnik <solomax...@gmail.com> > wrote: > >> Hello Sebastian, >> >> Is it possible to show confirmation dialog on drop (even pure JS or >> Wicket) >> and "revert" file if user choose cancel? >> >> -- >> WBR >> Maxim aka solomax >> > >