다음 코드는 행 (commandButton) 또는 행 (commandLink)을 추가 할 수있는 테이블에 대한 것입니다. 두 버튼 모두 작동하며 해당 bean 메소드를 호출합니다. 그러나 추가 버튼의 각 클릭에 대해 즉시 하나의 행을 추가하는 표가 업데이트되고 제거 버튼의 경우 행을 제거하기 위해 두 번 클릭해야합니다. 행이 처음으로 제거되지는 않지만 bean 메소드가 호출되고 있습니다. 어떻게해야합니까? 감사!Primeface 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>
있는 명령에서'아약스 = TRUE '를 제거하는 시도하고 많은 올바른 감사 년대'commandButton' – SRy