Wicket 的事件顺序是什么?
我是威克特的新手。我已经浏览了一些示例,但我仍然不确定 Wicket 的执行顺序是什么。
有人可以告诉我,对于这个例子
http://wicketstuff.org/wicket14/echo/
什么方法何时、以什么顺序被调用?如果我想在提交后清除字段,需要添加什么?
例如,在 Struts 2 中,系统将按顺序调用 prepare()
、setter 方法、validate()
和 execute()
。同理,Wicket 的顺序是什么?
I am new to Wicket. I have gone through some examples, but I am still not sure what Wicket's order of execution is.
Can someone tell me, for this example
http://wicketstuff.org/wicket14/echo/
what methods are called, when and in what order? If I want to clear the fields after submit, what needs to be added?
For example, in Struts 2, the system would call prepare()
, setter methods, validate()
and execute()
, in that order. In the same way, what is the order for Wicket?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
放置一个断点并检查代码以查看执行顺序。它与 struts 有很大不同。您可以在页面中自行设置方法名称,因此没有像 strutsexecute 这样的预定义方法。您应该阅读一些 wiki 来了解这个想法。
https://cwiki.apache.org/WICKET/wicket-reference.html
Place a breakpoint and go over the code to see the order of execution. It is pretty much different than struts. you set your method names yourself in your page so there is no predefined method like struts execute. You should read some wiki to get the idea.
https://cwiki.apache.org/WICKET/wicket-reference.html
我自己从来没有做过任何struts,但从我读到的内容来看,它与Wicket 有很大不同。
我无法告诉您正在调用的函数的名称,但执行顺序如下:
如果出现转换或验证错误,则调用 SubmitComponent 和 Form 的 onError()。
这能回答你的问题吗?
Never done any struts myself, but from what i read it is very different from Wicket.
I can 't tell you the names of the functions being called, but the order of execution is as follows:
In case of an conversion or Validation error, the onError() of the SubmitComponent and Form are called.
Does this answer your question?