我有一个下拉内容(实现css),每行都有按钮。当我点击按钮我想使用primefaces update =“”更改/删除下拉内容的一个li(注意,下拉内容不得关闭)。 但是,点击后我没有看到任何变化,在同一时间,来自服务器的响应是正确的。 为什么下拉内容不会重绘? 这是我的代码:
<h:form id="form" style="display: inline-block; height: 100%;">
<a href="#" id="dropButton"
class=" dropdown-button #{userContext.notificationsList.hasNewNotifications() ?'':'tooltipped'}"
data-tooltip="У Вас нет новых сообщений."
data-activates='messagesDropDown' data-constrainwidth="false" data-beloworigin="true"
data-gutter="20" style="height:100%">
<div>
<p:outputLabel id="NotificationLabel">
<i class="material-icons white-text">#{userContext.notificationsList.hasNewNotifications()?'notifications':'notifications_none'}</i>
<span id="messageNumber"
style="visibility: #{userContext.notificationsList.hasNewNotifications() ? 'visible' : 'hidden'}"
class="active-badge">#{userContext.notificationsList.newMessageCount}</span>
</p:outputLabel>
</div>
</a>
<div>
<p:outputLabel id="listMessage">
<ul id="messagesDropDown" class="dropdown-content " style="width:20%; ">
<ui:repeat id="allMessagaes" class="collection"
value="#{userContext.notificationsList.notificationList}"
var="message">
<p:panel id="panelWrapper">
<li id="oneMessage" class="collection-item truncate"
onclick="event.stopPropagation()"
style="background-color: #{message.read ? '#fafafa' : '#e0e0e0' }; border-bottom: 1px solid #757575;">
<div>
<div class="left "
style="padding: 10px; width:85%;white-space:normal; word-wrap: normal ">#{message}</div>
<div class="right">
<p:commandLink style="padding: 0"
actionListener="#{message.setRead(true)}"
oncomplete="reloadComponents(); "
update="@form:listMessage, @form:NotificationLabel"
><i
class="material-icons blue-text"
style="font-size: 20px">done_all</i></p:commandLink>
<p:commandLink style="padding: 0"
actionListener="#{userContext.notificationsList.removeNotification(message)}"
oncomplete="reloadComponents()"
update="@form:listMessage, @form:NotificationLabel"><i
class="material-icons blue-text"
style="font-size: 20px">close</i>
</p:commandLink>
</div>
</div>
</li>
</p:panel>
</ui:repeat>
</ul>
</p:outputLabel>
</div>
</h:form>