Created
February 21, 2014 00:43
-
-
Save jabaraster/9126628 to your computer and use it in GitHub Desktop.
Wicketでボタンを押したときにJavaScriptによる処理を挟む方法 ref: http://qiita.com/jabaraster/items/68119c48156ed0b84899
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final IndicatingAjaxButton button = new IndicatingAjaxButton("deleter") { | |
@Override | |
protected void updateAjaxAttributes(final AjaxRequestAttributes pAttributes) { | |
super.updateAjaxAttributes(pAttributes); | |
final AjaxCallListener ajaxCallListener = new AjaxCallListener(); | |
ajaxCallListener.onPrecondition("return confirm('この操作は取り消せません!本当に削除してよろしいですか?');"); | |
pAttributes.getAjaxCallListeners().add(ajaxCallListener); | |
} | |
@Override | |
protected void onSubmit(final AjaxRequestTarget pTarget, final Form<?> pForm) { | |
// サブミットしたときの処理 | |
... | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment