Huergo Perez wrote:
>
> What attribute of the Link should I modify with an attribute modifier?
> I could not find any examples of this functionality.
>
> Also, I found the IAjaxCallDecorator interface. Could it be used to
> display an alert after receiving an AJAX response?
>
> Thanks!
> Huergo
>
I've used something similar to the following in my code. If you want an
alert on the failure, use the decorateOnFailureScript() method of
IAjaxCallDecorator .
deleteLink.add(new AjaxEventBehavior("onclick") {
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
public CharSequence decorateScript(CharSequence script)
{
StringBuffer sb = new StringBuffer(256);
sb.append("if (confirm('Are you sure that you
want to delete this
item?')) { ");
sb.append(script);
sb.append("}");
return sb.toString();
}
};
}
@Override
protected void onUpdate(AjaxRequestTarget target) {
// do delete action here
}
});
Chuck
--
View this message in context:
http://www.nabble.com/Displaying-a-JavaScript-alert-after-a-click-on-a-link-tf3851561.html#a10915879
Sent from the Wicket - User mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user