You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by fachhoch <fa...@gmail.com> on 2012/07/12 13:41:57 UTC
wicket 1.5 confirmation ajaxbutton
I used confirmation for onclick of ajax button in 1.4 it worked when I try
the same with 1.5 it does not work.
here is the code
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-1-5-confirmation-ajaxbutton-tp4650460.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
Re: wicket 1.5 confirmation ajaxbutton
Posted by Andrea Del Bene <an...@gmail.com>.
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
Re: wicket 1.5 confirmation ajaxbutton
Posted by Decebal Suiu <de...@asf.ro>.
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
Re: wicket 1.5 confirmation ajaxbutton
Posted by Andrea Del Bene <an...@gmail.com>.
Please try to reattach the code. I can't read it neither in the mail nor
on line.
> I used confirmation for onclick of ajax button in 1.4 it worked when I try
> the same with 1.5 it does not work.
> here is the code
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-1-5-confirmation-ajaxbutton-tp4650460.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