}
@Override
protected org.apache.wicket.ajax.IAjaxCallDecorator getAjaxCallDecorator()
{
return new AjaxCallDecorator()
{
@Override
public CharSequence decorateOnSuccessScript(Component c, CharSequence script)
{
return "alert('Success');";
}
@Override
public CharSequence decorateOnFailureScript(Component c, CharSequence script)
{
return "alert('Failure');";
}
@Override
public CharSequence decorateScript(Component c, CharSequence script)
{
return "alert('Before ajax call');" + script;
}
};
};
});
add(new AjaxLink<Void>("failure-link")
{
@Override
public void onClick(AjaxRequestTarget target)
{
throw new WicketRuntimeException("Failure link clicked");
}
@Override
protected org.apache.wicket.ajax.IAjaxCallDecorator getAjaxCallDecorator()
{
return new AjaxCallDecorator()
{
@Override
public CharSequence decorateOnSuccessScript(Component c, CharSequence script)
{
return "alert('Success');";