<h:selectBooleanCheckbox id="includeTax" value="#{price.includeTax}"
oncomplete="javascript:selectOneElement(this);">
<a:support event="onclick" data="#{price}" actionListener="#{standardUnitPriceBean.validationTax}"/>
</h:selectBooleanCheckbox>
以上代碼放在xhtml不可用,是因爲selectBooleanCheckbox標籤中使用了調用js方法的屬性oncomplete(相關還有onclick、onchange.....),使用這個屬性會影響support執行,所以按照以下代碼書寫,可以解決support不執行的問題。
<h:selectBooleanCheckbox id="includeTax" value="#{price.includeTax}" >
<a:support event="onclick" data="#{price}"
oncomplete="javascript:selectOneElement(this);" actionListener="#{standardUnitPriceBean.validationTax}"/>
</h:selectBooleanCheckbox>
//格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");// 小寫hh是12小時制,大寫HH是24小時制。
//格式化數據
待續。。。