一些Tapestry FAQ

本文详细介绍了表单提交的生命周期,包括初始化、渲染等关键阶段,并解释了如何区分重置与正常渲染周期。此外,还提供了在模板中复用组件的方法及创建链接以弹出新窗口的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

What's the lifecycle of a form submit?

Events will trigger in the following order:

  • initialize()
  • pageBeginRender() ("rewind")
  • rewind of the form / setting of properties
  • Deferred listeners (for Submit components)
  • Form's listener
  • pageEndRender() ("rewind")
  • pageBeginRender() (normal)
  • pageEndRender() (normal)

The form "rewind" cycle is nothing more than a render cycle where the output is buffered and scrapped rather than written to the servlet output stream. The second pageBeginRender() is triggered during the actual page rendering. You can use requestCycle.isRewinding() to distinguish between these two render cycles.

 

Can I use the same component multiple times in one template?

No - but you can copy the definition of a component pretty easily.

xml 代码
  1. <component id="valueInsert" type="Insert">  
  2.    <binding name="value" value="getValueAt( rowIndex, columnIndex )"></binding>  
  3. </component>  
  4.   
  5. <component id="valueInsert1" copy-of="valueInsert"></component>  
  6. <component id="valueInsert2" copy-of="valueInsert"></component>  
  7. <component id="valueInsert3" copy-of="valueInsert"></component>  
  8. <component id="valueInsert4" copy-of="valueInsert"></component>  

 

How do I make a link popup a new window?

Use the contrib:PopupLink component.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值