简体   繁体   English

我在使用a4j:commandButton和重新设置时遇到麻烦

[英]I have trouble with a4j:commandButton and a reredering

The code below show whiche thing that is failing in my appliaction. 下面的代码显示在我的应用程序中失败的内容。 It is a quick add information form, fill out the form and submit it add a new entry into a database and synchronize my a databasle.. This is all done with ajax. 这是一个快速添加信息的表单,填写该表单并将其提交,然后将其添加到数据库中,然后使我的数据库同步。.所有这些都由ajax完成。 The first form submission happens correctly but the second one fails to run the desired ActionListener. 第一个表单提交正确发生,但是第二个表单无法运行所需的ActionListener。 The second form is posting to the server though but the saveAction isn't invoke. 第二种形式虽然是发布到服务器,但是不调用saveAction。 As you will see, I'm a real beginner with this technologies ... If someone see the problem, it will be very helpfull !! 如您所见,我是使用该技术的真正初学者...如果有人看到了问题,那将非常有帮助!

<rich:simpleTogglePanel id="quickaddActivitySimpleToogle"
 switchType="client" 
 opened="false"
 label="#{lang.activityModule_quickAdd_panelTitle}">
<p><a4j:form id="quickAddForm">
 <h:outputLabel for="activityNameInput"
  value="#{lang.activity_name_dp}" />
 <h:inputText id="activityNameInput"
  value="#{activityController.quickActivityAdd.name}">
 </h:inputText>
 <rich:spacer width="20px" />

 <h:inputHidden id="activityInternalNameInput"
  value="#{activityController.quickActivityAdd.internalName}" />
 <rich:spacer width="20px" />
 <a4j:commandButton id="activityQuickAddFormSubmitBtn"
  reRender="activityListTable,quickAddForm"
  actionListener="#{activityController.saveActivity}" 
  value="#{lang.saveBtn_header}" />
</a4j:form></p></rich:simpleTogglePanel>

Thanks in advance. 提前致谢。

ollie314 ollie314

  1. I'd suggest putting <a4j:form> as the most outer element 我建议将<a4j:form>作为最外部的元素
  2. put immediate="true" on the commandButton to bypass validation 在命令按钮上放置commandButton immediate="true"以绕过验证
  3. don't reRender the whole form - add a <h:panelGroup> inside, and rerender it instead. reRender整个形式-添加<h:panelGroup>内,并且重新解析它来代替。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM