You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Federico Fanton <ff...@ibc.it> on 2007/11/23 11:04:26 UTC
Aborting Ajax component replacing
Hi everyone!
I'm sorry, I'm triying to implement this workflow:
- user presses on Ajax button
- if server-side check returns false, refresh component X
- if server-side check returns true, ask confirmation to user via JS confirm(), and eventually refresh component X
I tried using something like
if(check())
ajaxTarget.prependJavascript("if(!confirm('You sure?')) return false;");
ajaxTarget.addComponent(componentX);
but in Ajax Debug Window i get "SyntaxError: invalid return".. Is there a way to abort ajax component replacing from prependJavascript?
(I'll use a ModalWindow if it's not possible, but I'd like to avoid it ^^ )
Many thanks for your time!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Aborting Ajax component replacing
Posted by Federico Fanton <ff...@ibc.it>.
On Fri, 23 Nov 2007 11:04:26 +0100
Federico Fanton <ff...@ibc.it> wrote:
> but in Ajax Debug Window i get "SyntaxError: invalid return".. Is there a way to abort ajax component replacing from prependJavascript?
Mmh.. This
> r579593 | knopp | 2007-09-26 13:16:51 +0200 (Wed, 26 Sep 2007) | 1 line
>
> Allow arbitrary delaying of Ajax pipeline using prepend/append javascript
inside wicket-ajax.js changelog looks promising.. Am I mistaken? ^^;
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org