在提交Wicket&ŧ039;s AjaxButton的脚本之前
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在提交Wicket&ŧ039;s AjaxButton的脚本之前相关的知识,希望对你有一定的参考价值。
new AjaxButton("save") { @Override protected IAjaxCallDecorator getAjaxCallDecorator() { return new DisableComponentCallDecorator(super.getAjaxCallDecorator(), this); } } class DisableComponentCallDecorator extends AjaxPreprocessingCallDecorator { super(delegate); this.selector = jquerySelector; } super(delegate); component.setOutputMarkupId(true); this.selector = "#" + component.getMarkupId(); } @Override public CharSequence preDecorateScript(CharSequence script) { return "$('" + selector + "').addClass('disabled_while_waiting').attr('disabled','disabled'); " + super.preDecorateScript(script); } @Override public CharSequence preDecorateOnSuccessScript(CharSequence script) { return "$('" + selector + "').removeAttr('disabled'); " + super.preDecorateOnSuccessScript(script); } @Override public CharSequence preDecorateOnFailureScript(CharSequence script) { return "$('" + selector + "').removeAttr('disabled'); " + super.preDecorateOnFailureScript(script); } }
以上是关于在提交Wicket&ŧ039;s AjaxButton的脚本之前的主要内容,如果未能解决你的问题,请参考以下文章