首页 > 解决方案 > Tapestry Page 翻到下一页:点击下一页(如果下一页的表格内容是可编辑的,tapestry 会报错)

问题描述

点击下一页(如果下一页表格元素上的表格内容包含<input: type="text">

org.apache.tapestry5.ioc.internal.util.TapestryException: elementValue 组件必须由 Form 组件包围。[at classpath:com/zte/easweb/pages/home/MyInvoice.tml, line 178] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:948) at org.apache.tapestry5.internal .structure.ComponentPageElementImpl.access$400(ComponentPageElementImpl.java:49) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.callback(ComponentPageElementImpl.java:159) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$ SetupRenderPhase.render(ComponentPageElementImpl.java:189)

我的发票.java

public class MyInvoice {

    public Pagination<FbpInvoiceV> getFbpInvoiceList() {
        try {
            logger.info("....1");
            fbpInvoiceList = bc4Boe.boe__queryMyInvoiceList(searchCondition, grid.getCurrentPage(),grid.getRowsPerPage());
        } catch (Exception e) {
            logger.error("....2", e);
        }
        return fbpInvoiceList;
    }

    public boolean canNotUpdateInvoice(Integer index) {
        FbpInvoiceV invoice = fbpInvoiceList.getItems().get(index - 1);
        String checkStatus = invoice.getCheckStatus();
        String standardCheckStatus = invoice.getStandardCheckStatus();
        if ("4".equals(checkStatus) || "4".equals(standardCheckStatus)) {
            return true;
        }
        return false;
    }
}
<html>
 <head></head>
 <body>
  <t:form t:id="optForm" clientvalidation="false"> 
   <div class="pannel1"> 
     <t:grid.zgrid t:id="grid" source="fbpInvoiceList" row="row" lean="true" rowsperpage="10" include="no,invoiceNo" model="model"> 
     <t:parameter name="invoiceNoCell"> 
      <div align="center" style="display: inline-block; white-space: nowrap;"> 
       <t:if t:test="${canNotUpdateInvoice(row.no)}">
         ${row.invoiceNo} 
        <p:else> 
         <t:textfield t:id="invoiceNo" name="invoiceNo" value="row.invoiceNo" /> 
        </p:else> 
       </t:if> 
      </div> 
     </t:parameter>
    </t:grid.zgrid> 
   </div> 
  </t:form> 
 </body>
</html>

标签: javahtmltapestry

解决方案


推荐阅读