wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Del Bene <an.delb...@gmail.com>
Subject Re: wicket 1.5 confirmation ajaxbutton
Date Fri, 13 Jul 2012 12:56:51 GMT
Hi,

I've tried your code with Wicket 1.5.7 and it seems to work. What kind 
of error are you getting?
> 		add(new AjaxLink<File>("delete") {
>
> 			@Override
> 			public void onClick(AjaxRequestTarget target) {
> 			}
> 			
> 			@Override
> 			protected IAjaxCallDecorator getAjaxCallDecorator() {
> 				return new ConfirmAjaxDecorator("Delete?");
> 			}
>
> 		});
>
> public class ConfirmAjaxDecorator extends AjaxCallDecorator {
> 	
>      private String message;
>
>      public ConfirmAjaxDecorator(String message) {
>          this.message = message;
>      }
>
>      @Override
> 	public CharSequence decorateScript(Component c, CharSequence script) {
>          return new
> StringBuilder("if(!confirm('").append(message).append("')) { return false;
> };").append(script);
>      }
>
> }
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-1-5-confirmation-ajaxbutton-tp4650460p4650462.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



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


Mime
View raw message