Juh*_*älä 1 ajax wicket event-handling javascript-events
如何轻松链接Wicket的AjaxFormComponentUpdatingBehavior,以便可以从单个Javascript事件触发多个行为.我正在使用Wicket 1.4.
例如,当onblur事件发生时,我喜欢触发这两种行为.我只关心触发onUpdate()方法.如果我这样做,似乎只触发了一个行为.实现这一目标的一种方法是让一个行为同时执行A和B操作,但我正在寻找更具创造性的东西.
field.add(new AjaxFormComponentUpdatingBehavior("onblur") {
protected void onUpdate(AjaxRequestTarget target) {
// do thing A here
getComponent(); // behaviors need a reference to field they are attached to
}
});
field.add(new AjaxFormComponentUpdatingBehavior("onblur") {
protected void onUpdate(AjaxRequestTarget target) {
// do thing B here
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2079 次 |
| 最近记录: |