I'm facing an issue where I have a form capturing Contract records and displaying them in a datatable. The datatable has an "Edit" commandlink tag, which when clicked should populate the form with the contract data, but disable the Contract No field. I've implemented this disabling functionality using Ajax onEvent tag, which is working fine. However, the fields are not being populated/displayed in the form when the Ajax is used. If I remove it, everything works except that the Contract No field becomes editable. Here are my edit tags.
<h:commandLink id="editLink" value="#{bundle.ListUnitEditLink}" >
<f:ajax onevent="disablePK" listener="#{contractManager.updateContract}" />
</h:commandLink>
This is my backing bean.
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";
}
The properties in the bean are being assigned correct values, but they are not showing up in the form for editing.