第三十五讲:tapestry Ajax zone组件无黄色闪烁的背景
生活随笔
收集整理的這篇文章主要介紹了
第三十五讲:tapestry Ajax zone组件无黄色闪烁的背景
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
實現方法很簡單,在zone組件里加上t:update="show"就不會出現黃色背景了。源碼如下:
ZoneWithoutYellowHighlight.java
/** * 項目名稱:TapestryStart * 開發模式:Maven+Tapestry5.x+Tapestry-hibernate+Mysql * 網址: http://www.flywind.org * 版本:1.0 * 編寫:飛風 * 時間:2012-02-29 */ package com.tapestry.app.pages; import java.util.Date; import org.apache.tapestry5.annotations.InjectComponent; import org.apache.tapestry5.corelib.components.Zone; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.services.Request; public class ZoneWithoutYellowHighlight { @Inject private Request request; @InjectComponent private Zone time2Zone; void onActionFromRefreshPage(){} Object onActionFromRefreshZone(){ return request.isXHR()?time2Zone.getBody():null; } public Date getServerTime1(){ return new Date(); } public Date getServerTime2(){ return new Date(); } }ZoneWithoutYellowHighlight.tml
<html t:type="layout" title="tapestryStart Index" ?t:sidebarTitle="Framework Version"? xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter"> <div style="margin-left: 50px"> <a t:type="actionlink" t:id="refreshPage" href="#">ActionLink刷新頁面</a><br/> <a t:type="actionlink" t:id="refreshZone" href="#" t:zone="time2Zone">ActionLink AJAX無刷新</a><br/><br/> serverTime1: ?${serverTime1} <t:zone t:id="time2Zone" t:update="show"> serverTime2: ?${serverTime2} </t:zone><br/> </div> </html>轉載于:https://my.oschina.net/shootercn/blog/55135
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的第三十五讲:tapestry Ajax zone组件无黄色闪烁的背景的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 淘手游
- 下一篇: ASCII和Unicode编码