I have a number of forms on the page, each with its own submit button. They are each in a separate tab.
When I click on the submit button on the second form I believe that the top form is submitted but the eventListener for the second button is fired in the bean. This is because the object bound to the form has field values of those set in the top form when I submit.
Code: Select all
<h:form id="cartridgeAssetForm1" prependId="false">
<h:panelGrid columns="2" >
<h:outputLabel value="Code" for="itemCode" />
<h:inputText id="aa" value="#{defaultItemController.selected.code}" title="Code" />
<h:outputLabel value="Name" for="itemName" />
<h:inputText id="bb" value="#{defaultItemController.selected.name}" title="Name" />
<h:outputLabel value="Description" for="itemDescription" />
<h:inputText id="cc" value="#{defaultItemController.selected.description}" title="Description" />
<h:outputLabel value="Category" for="itemCategory" />
<h:inputText id="dd" value="#{defaultItemController.selected.category}" title="Category" />
</h:panelGrid>
<p:commandButton actionListener="#{defaultItemController.store}" value="Update" update="assetList" immediate="true" type="submit" />
</h:form>
<h:form id="cartridgeAssetForm2" prependId="false">
<h:panelGrid columns="2" >
<h:outputLabel value="Code" for="itemCode" />
<h:inputText id="a" value="#{defaultItemController.selected.code}" title="Code" />
<h:outputLabel value="Name" for="itemName" />
<h:inputText id="b" value="#{defaultItemController.selected.name}" title="Name" />
<h:outputLabel value="Description" for="itemDescription" />
<h:inputText id="c" value="#{defaultItemController.selected.description}" title="Description" />
<h:outputLabel value="Category" for="itemCategory" />
<h:inputText id="d" value="#{defaultItemController.selected.category}" title="Category" />
</h:panelGrid>
<p:commandButton actionListener="#{defaultItemController.store}" value="Update" update="assetList" immediate="true" type="submit" process="cartridgeAssetForm"/>
</h:form>
When I look in the HTML I can see that each submit button references the correct form id, however it seems the referenced form is not being submitted.
Has anyone else seen this?