Showing posts with label EventLink. Show all posts
Showing posts with label EventLink. Show all posts

Monday, October 06, 2008

Tapestry5 中事件处理完成之后可以返回的对象类型

  • Nothing: 此时方法一般是void的,当前页面会被刷新。
  • String: 要求此string指向一个PageName。
  • Class: 返回一个SomePage.class。
  • Page: 返回一个实例化的page,此page被当前页面注入。
  • Link: 返回一个实现Link接口的实例,此Link会被转化成对应的URL并重定向到此页面,Link对象一般通过页面中注入的ComponentResources中的方法生成,如ComponentResources.createPageLink、ComponentResources.createActionLink。
  • Stream: 返回一个StreamResponse对象,如提供用户pdf/excel格式的下载,更多用于ajax返回。
  • URL: 返回一个URL对象,可以重定向到一个外部链接上去。
返回除以上几种对象之外的对象都会出错。
Reference: http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html

Saturday, July 19, 2008

ActionLink / EventLink / Form submission differences

ActionLink, EventLink, and Form submission all cause the ACTION-REQUEST-RENDER sequence of events. However, in other ways they differ:


* ActionLink and EventLink can submit "context" parameters; Form can submit all of its input and hidden fields.
* ActionLink and EventLink send an HTTP GET; Form sends an HTTP POST (POST allows much more data and doesn't display the data in the URL).
* ActionLink generates one event: ACTION; EventLink generates one event that it nominates. Form generates many events including VALIDATE_FORM, SUCCESS, and FAILURE.

Reference:
http://files.doublenegative.com.au/jumpstart/home.html