Следующий код относится к таблице, в которую я могу добавить (commandButton) или удалить (commandLink) строки. Обе кнопки работают и вызывают соответствующие методы компонента. Но в то время как каждый щелчок по кнопке добавления будет обновлять таблицу, мгновенно добавляя одну строку, для кнопки удаления мне нужно дважды щелкнуть по ней, чтобы удалить строку. Несмотря на то, что строка не удаляется в первый раз, вызывается метод компонента. Что я должен делать? Спасибо!
<h:form id="form">
<table>
<tr>
<td>
<h:panelGrid columns="2" width="100%">
<p:dataTable id="univertitiesTable" value="#{universityBean.universityList}" var="university"
editable="true" editMode="cell" style="align:center;" >
<p:column headerText="Name" style="width:80px" >
<p:inputText value="#{university.name}" style="width:25px;" id="nameField" label="name" />
</p:column>
<p:column headerText="" style="width:20px; ">
<p:commandLink actionListener="#{universityBean.deleteUniversity}" update="univertitiesTable" id="removeButton" ajax="true">
<h:graphicImage value="/resources/icones/delete.gif" />
<f:setPropertyActionListener value="#{university}"
target="#{universityBean.university}" />
</p:commandLink>
</p:column>
</p:dataTable>
<p:commandButton value="+" update="univertitiesTable" id="addButton" ajax="true"
actionListener="#{universityBean.addUniversity}"
styleClass="ui-priority-primary" />
</h:panelGrid>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<h:commandButton id="save" value="Save"
action="#{universityBean.save}" binding="#{save}" />
</td>
</tr>
</table>
</h:form>
ajax=true
из commandButton и добавитьprocess=@this
кcommandButton
- person SRy   schedule 16.11.2013