开发者

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. The first form submission happens correctly but the second one fails to run the desired ActionListener. The second form is posting to the server th开发者_JAVA百科ough but the saveAction isn't invoke. 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


  1. I'd suggest putting <a4j:form> as the most outer element
  2. put immediate="true" on the commandButton to bypass validation
  3. don't reRender the whole form - add a <h:panelGroup> inside, and rerender it instead.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜