作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我有这段代码(不详细)
<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) 中重置这些输入的值,我对吗?
最佳答案
查看 primefaces 为 reset input 提供的服务或者在通过 bean 中的操作提交表单后,通过 new 或 null 重置值并重新创建
持有的列表<h:selectOneMenu>
关于jsf-2 - 如何在jsf中提交表单输入后重置表单输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19355253/
我是一名优秀的程序员,十分优秀!