I had form in which i got input field with validation and submit button which placed the values of the input field into a table
The table had delete column which allowed to delete a row
the thing is that the delete row link failed on validation if there was no value in the input field
so i placed the input field with the submit button in 1 form and in the second form i placed the data table
now when user type the value into the input field and clicks on the submit i update id of the table (which is located inside the second form, i use the update attribute of the command button)
my question is this right thing to do? or i better place all inside one form
here is the input field code (using 2.2.RC2)
Code: Select all
<h:inputText id="email" value="#{settingsBean.aFriendEmail}" required="true" label="Email" validatorMessage="The email is not correct">
<f:validateRegex pattern="[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-zA-Z0-9]+" />
</h:inputText>
Code: Select all
<p:column headerText="Delete" style="width:30px">
<p:commandLink ajax="true" action="#{settingsBean.removeEntity}" update="@form" process="@form" styleClass="ui-icon ui-icon-trash">
<f:setPropertyActionListener
target="#{settingsBean.selectedFriendToDeleteFromTable}"
value="#{friend}" />
</p:commandLink>
</p:column>
Thanks ahead
Daniel.