【发布时间】:2013-07-24 04:15:30
【问题描述】:
这是我正在编写的一些 html,允许使用对话框添加类别:
<p:dialog id="newCategoryDlg" header="Add New Category" widgetVar="newCategoryDialog" resizable="false">
<h:form id="newCategoryForm">
<p:panelGrid id="displayNewCategory" columns="2" cellpadding="4" style="margin:0 auto;">
<h:outputText value="Category Name :"></h:outputText>
<p:inputText value="#{categoryController.newCategory.name}"
required="true" requiredMessage="Please Enter a Category ID!" />
<f:facet name="footer">
<p:commandButton value="Submit" update=":form:categoryTable"
oncomplete="newCategoryDialog.hide();"
actionListener="#{categoryController.addCategory}">
<p:resetInput target="displayNewCategory" />
</p:commandButton>
<p:commandButton type="reset" value="Reset"></p:commandButton>
</f:facet>
</p:panelGrid>
</h:form>
</p:dialog>
现在,无论出于何种原因,无论我使用哪个小部件或标识符,“”似乎都不起作用。我想要的只是旧的输入条目在提交后消失。我做错了什么?
【问题讨论】:
-
你只是误解了它的目的。
-
我明白了。我认为它可能不会像我预期的那样工作。我已经查看了这个链接,但它似乎没有提供我正在寻找的东西。你知道我应该用什么吗?
-
该链接在最后一段中有您的实际解决方案,并包含“另见”链接。
-
直截了当,我也没有看到它。我所需要的是,当用户提交,然后再次打开对话框以提交另一个时,该字段为空。但它保留了上一次尝试的价值。在链接中看不到类似的内容!
标签: jsf primefaces dialog reset