所以我有这个代码(不详细)
<p:tabView id="tabviewId">
<p:tab>
<h:form id="mainHeadOfAccountsId_form">
// some input fields with validation
// using viewscoped
<p:commandButton value="Add" process="mainHeadOfAccountsId_form" update="mainHeadOfAccountsId_form :#{p:component('allMainHeadOfAccountsId_table')} :#{p:component('successfullySavedUpdatedId_growl')}" action="#{budgetHeadOfAccountsAction.addMainHeadOfAccountsOnAjax}" />
/// also using <p:datatable id= "allMainHeadOfAccountsId_table" >
</h:form
</p:tab>
<p:tab>
<h:form>
</h:form
</p:tab>
</p:tabView>
<p:growl id="successfullySavedUpdatedId_growl" for="successfullySavedUpdatedFor_growl" value="error" showDetail="false" />
我的问题是,当我mainHeadOfAccountsId_form
成功提交表单时,我需要更新(重置)其中的所有字段,mainHeadOfAccountsId_form
但请记住我也在使用<h:selectOneMenu>
,所以我想重置(选项 [0] 选择)不为空,我该怎么做?目前它正在更新allMainHeadOfAccountsId_table
,successfullySavedUpdatedId_growl
除了mainHeadOfAccountsId_form
我已经累了tabviewId:mainHeadOfAccountsId_form
但没有找到异常组件,因为我认为这只是因为@viewScoped
我应该在我的操作类(.java)中重置这些输入的值,对吗?