使用p:commandbutton提交多个表单 [英] submit multiple forms with p:commandbutton
本文介绍了使用p:commandbutton提交多个表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用一个提交按钮提交多个表格.我有多种形式,因为每个p:fileUpload需要一个自己的形式(在高级模式下).
I want to submit multiple forms with one submit button. I have multiple forms because each p:fileUpload needs an own form (when in advanced mode).
这是我的提交按钮的代码:
Here's the code for my submit button:
<h:form id="form1">...</h:form>
<h:form id="form2">...</h:form>
<h:form>
<p:commandButton value="Save" widgetVar="saveButtonBottom"
action="#{bean.submit}" ajax="false"
process=":form1,:form2,@this" />
</h:form>
它确实调用bean.submit(),但不处理其他形式.也许我对处理的理解是错误的,但是我认为如果将表格放入流程"中,那么它将被提交.
It does call bean.submit(), but it does not process the other forms. Maybe my understanding of processing is wrong, but I thought if I put a form into "process", then it will be submitted.
任何想法如何使其起作用?
Any idea how to make it work?
推荐答案
将其放在form2中:
Place this inside form2:
<p:remoteCommand name="sendAjaxicalPGfilter"
update="form2:minMaxTable"
action="#{OptimizationSettingsBean.handleProductGroupChange}" />
在form1命令按钮上调用
call this on form1 command button
<p:commandButton value="Done"
oncomplete="selectedSettingDlg.hide();" onstart="sendAjaxicalPGfilter();"
ajax="true" action="#{CreateSourcingPlanBean.dummy}"
update=":form1:assignmentList" >
</p:commandButton>
这篇关于使用p:commandbutton提交多个表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文