tapestry中的读取url进行数据处理

 前几天接触到一个ajax应用需要把页面点击后的实体传递到一个及时打开的window里去,想来想去只能把id进行传递,因为涉及到多个window及参数,可以使用url进行辩别.

  查了下tapestry的event,可以找到有如下的EventConstants:

static StringACTION
          Default client event name, "action", used in most situations.
static StringACTIVATE
          Event triggered when a page is activated (for rendering).
static StringADD_ROW
          Event triggered by AjaxFormLoop to inform the container that a new row has been requested.
static StringFAILURE
          Event type for a notification after the form has been submitted, when there are errors in the validation tracker.
static StringPARSE_CLIENT
          Event triggered by some form-related cmponents to parse a value provided by the client.
static StringPASSIVATE
          Event triggered when a link for a page is generated.
static StringPREPARE
          Invoked to let the containing component(s) prepare for the form rendering or the form submission.
static StringPREPARE_FOR_RENDER
          Invoked before PREPARE when rendering out the form.
static StringPREPARE_FOR_SUBMIT
          Invoked before PREPARE when the form is submitted.
static StringREMOVE_ROW
          Event triggered by AjaxFormLoop to inform the container about the row removed on the client side.
static StringSELECTED
          Event type triggered by the Submit component when it is the cause of the form submission.
static StringSUBMIT
          Event type for a notification after the form has submitted.
static StringSUCCESS
          Event type for a notification after the form has submitted, when there are no errors in the validation tracker.
static StringTO_CLIENT
          Event triggered by some form-related components to convert a server-side value to a client-side string, as an alternative to a Translator.
static StringVALIDATE
          Event triggered by form-related components to validate user input.
static StringVALIDATE_FORM
          Event type for a notification to perform validation of submitted data.
  ,因此看到activate是在页面打开时进行处理的,所以demo程序如下

 

 @OnEvent(value="activate") 
    void activateConfirmEdit(Integer id, boolean reload){
   
        this.reload = reload;
        if (reload){
            this.id = id.longValue();
           
        }
    }

 

读取了url里的内容,并进行了提取.使页面得到了应有的初始参数,以便进一步处理.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值