1
我有一個表單,其中有一個輸入文本,操作員輸入該文件並單擊「搜索」,當搜索結束時,表單中的其他字段填充正確。帶有2個按鈕的Primefaces表格不更新
然後,我有一個「新記錄」按鈕,它調用一個創建另一個對象(不是客戶)的過程並需要保留它,當另一個對象在bean中創建時,時間戳。
當對象被持久化時,只有時間戳記在DB中,所有的表單值都被設置爲null。
<h:form id="myForm">
<h:outputText value="Customer number" />
<h:inputText id="cIdentidad" value="#{custBean.custID}" />
<p:commandButton process="@all" update="@all" action="#{custBean.populateFields(custBean.custID)}" value="Search" />
<p:growl />
<h:panelGrid id="newCust" columns="2" style="margin-top: 15px">
<h:outputText value="Name" />
<h:inputText id="name" value="#{custBean.name}" disabled="true"/>
<h:outputText value="more fields" />
<h:inputText id="nroAgenda" value="#{custBean.morefields}" disabled="true"/>
</h:panelGrid>
<p:commandButton process="@all" update="@all" action="#{custBean.newRecord()}" value="New record" />
</h:form>
這個bean是sessionscoped – Alexev