我遇到了 primefaces 命令按钮和数据表的问题。我在数据表中有两个按钮。当我每次先加载数据表然后调用按钮操作时单击按钮。我只想避免单击按钮时加载数据表。
<p:dataTable id="alphaTable" var="cs" binding="#{challengeSetBean.alphaChallengeSetTable}"
value="#{challengeSetBean.challengeSet}" styleClass="myTable"
style="list-style-type:none;width:600px;border:1px;" >
<p:column id="col" style="width:20px;font-size:12px;padding-left:7px;padding-bottom:7px;padding-top:7px;">
..................
................
</p:column>
<p:column style="width:28px;font-size:9px;padding-left:7px;padding-bottom:7px;padding-top:7px;">
<p:commandButton value="#{msg.updateAccount_reset}" action="#{challengeSetBean.editAnswer()}" immediate="true" rendered="#{!cs.editMode}" process="@this" update="col" >
</p:commandButton>
<p:commandButton value="#{msg.common_save}" action="#{challengeSetBean.saveAnswers()}" rendered="#{cs.editMode}" ajax="true" immediate="true" update="@form"/>
<p:commandButton value="#{msg.cancel}" action="#{challengeSetBean.cancelAnswer()}" rendered="#{cs.editMode}" ajax="true" immediate="true" update="@form"/>
<p:commandButton value="#{msg.common_delete}" action="#{challengeSetBean.deleteAnswer()}" rendered="#{!cs.editMode}" immediate="true" update="@form"/>
</p:column>
</p:dataTable>