我有这两个commandButton的问题:加入和离开。命令按钮ajax渲染后不活动
我想隐藏加入,如果我点击休假,反之亦然。
当我把阿贾克斯假,没有问题(但所有的页面刷新,我没有找到最佳)。
但是,当ajax attribut在特定更新时为true(参见代码注释),渲染效果很好,但出现的新按钮变为非活动状态。如果我点击它,什么都没有发生(好像它似乎是actionListener触发器,但视图没有刷新,我不得不手动刷新以查看区别)
感谢您的阅读。
<h:form id="formWaitingList" rendered="#{connexion.connected}" >
<p:commandButton id="Join"
actionListener = "#{connexion.joinWaitingList()}"
rendered="#{!connexion.waiting}"
ajax="false"
<!-- ajax="true"
update="Join,Leave"-->
value="Join"/>
<p:commandButton id="Leave"
value="Leave"
ajax="false"
<!-- ajax="true"
udpate="Join,Leave"-->
rendered="#{connexion.waiting}"
actionListener ="#{connexion.leaveWaitingList()}" />
</h:form>
你应该使用update = “@的形式”,这种情况下,因为'buttons'与渲染=假没有按不会出现在html生成的代码中,所以你不能直接更新它们。 – danRod