primefaces部分提交数据表
我需要使用此处描述的功能创建一个数据表如何动态添加 JSF 组件< /a>
它有效,但在我的表单中,除了这个数据表之外,我还有其他元素。我需要当单击添加按钮时,除了创建新字段之外,仅提交数据表中输入的数据。但 contact.email 的值始终为空。我正在尝试使用 primefaces 命令按钮。
<h:form>
//other elements
<h:panelGrid id="region" columns="1">
<p:commandButton action="#{myBean.addContact}" update="region" value="add" immediate="true" process="region @this" ajax="true"/>
<h:dataTable id="addContacts" value="#{myBean.contacts}" var="contact">
<h:column>
<p:inputText id="email" value="#{contact.email}" />
</h:column>
</h:dataTable>
</h:panelGrid>
</h:form>
我怎样才能使这个部分提交工作?
谢谢
I needed to create a datatable with the functionality described here How to dynamically add JSF components
It works, but in my form, besides this datatable I have other elements. I needed that when the add button is clicked, only the data entered in the datatable is submitted besides creating the new field. But the values to contact.email are always null. I'm trying to use primefaces commandbutton.
<h:form>
//other elements
<h:panelGrid id="region" columns="1">
<p:commandButton action="#{myBean.addContact}" update="region" value="add" immediate="true" process="region @this" ajax="true"/>
<h:dataTable id="addContacts" value="#{myBean.contacts}" var="contact">
<h:column>
<p:inputText id="email" value="#{contact.email}" />
</h:column>
</h:dataTable>
</h:panelGrid>
</h:form>
How can I make this partial submit work?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 PrimeFaces 中尝试在表单中使用 prependId="false" 属性
In PrimeFaces try using prependId="false" attribute in the form
使用逗号分隔要部分提交的组件
use commas to separate the components you want to partially submit