0

我在上面有一个表单,它捕获合同记录并将它们显示在具有命令链接“编辑”标签的数据表中。当我单击“编辑”时,我希望在表单中填充此合同数据,但禁用“合同号”字段。我正在尝试在 Ajax onEvent 标记中禁用此功能,并且它正在工作(即禁用)。但是,当使用 ajax 时,不会在表单中填充/显示字段。如果我删除它,一切都很好,只是合同编号是可编辑的。这些是我的编辑标签。

<h:commandLink id="editLink"  value="#{bundle.ListUnitEditLink}"   >
   <f:ajax   onevent="disablePK" listener="#{contractManager.updateContract}"  />
</h:commandLink>

这是我的后盾。

public String updateContract() {
    System.out.println("Now in UPDATECONTRACT method and serious debugging");
    current = (Contract) items.getRowData();
    this.newContractId=current.getContractid();
    this.newContractDesc=current.getContractdesc();
    this.newContractDt=current.getContractdt();
    this.newContractAmt=current.getContractamt();
    this.newContractStrtDt=current.getContractstrtdt();
    this.newExpDuration=current.getExpduration();
    this.newCtdBy=current.getCtdby();
    this.newCtdOn=current.getCtdon();
    this.lstUpdBy=current.getLstupdby();
    this.lstUpdOn=current.getLstupdon();
    return "contracts";
}

bean 中的属性被赋予了正确的值,但它们没有出现在要编辑的表单中。

4

1 回答 1

0

我通过在 ajax 标记中添加 render=@all 来解决我的问题

 <h:commandLink id="editLink"  value="#{bundle.ListUnitEditLink}"  
                                       actionListener="#{contractManager.updateContract}">
         <f:ajax   onevent="disablePK"   render="@all"  />

 </h:commandLink>
于 2012-08-07T07:57:26.310 回答