Tapestry页面转到下一页:单击下一页(如果下一页的表内容是可编辑的,tapestry将报告错误)

时间:2019-11-01 04:27:21

标签: java html tapestry

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

  

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

MyInvoice.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>

0 个答案:

没有答案