我有一個頁面,其中a4j:commandbutton捕獲2個文本框的值。該文本框的值默認這種方式:如何將輸入文本值重置爲默認值?
<a4j:region id="pnreg" >
<h:inputText id="pn" binding="#{bean.pn}"
value="Enter Number..."
onclick="clickclear(this, 'Enter Number...')"/>
</a4j:region>
</td>
<td width="20">
<a4j:region id="qtyreg" >
<h:inputText value="Enter Part Qty..." id="qty" binding="#{bean.qty}"
onclick="clickclear(this, 'Enter Qty...')"/>
</a4j:region>
</td>
<td width="20%">
<a4j:commandButton id="addPart" render="pn,qty" value="Add Part"
action="#{bean.submit}" />
當第一次加載頁面文本框顯示的默認值,當其用戶點擊的編碼值將被清除。當按鈕被點擊時,我希望文本框返回到默認值。使用jquery我想我需要添加一個點擊事件處理程序,但是richfaces api已經有一個附加到a4j:commandbutton的事件處理程序。我如何讓我的jQuery的eventhandler與richfaces eventhandler一起工作?謝謝。
,這是通過簡單地創建與輸入完成「重置」的類型,它將顯示爲一個按鈕。 – Shea 2012-04-12 02:32:58