好男人,我知道像我這樣的另一個相關的問題,但我已經嘗試瞭解決方案,但仍然沒有工作。我的繼承人JSF如何使用jsf primefaces選擇所有booleancheckbox?
<h:form id="store-news-check">
<ul style="list-style: none;padding:5px;margin-top:0px">
<ui:repeat value="#{dashboardBean.storeNewsList}" var="item" varStatus="status">
<li style="display:inline-flex;width: 100%;margin-bottom: 5px">
<p:selectBooleanCheckbox value="#{item.cmsCheck}" style="margin-bottom:0px" />
<a href="#" style="color:#333"><span class="task-name">#{item.storeId.name} - ${fn:substring(item.title,0, 10)} ....</span></a>
</li>
</ui:repeat>
</ul>
<p:commandButton actionListener="#{dashboardBean.selectAllNews()}" value="Select All" update="@form" icon="ui-icon-send" style="border-radius:3px 0px 0px 3px"/>
<p:commandButton value="Save" icon="ui-icon-send" style="border-radius:0px 3px 3px 0px"/>
</h:form>
和繼承人我支持bean
@PostConstruct
public void init() {
storeNewsList = storeNewsFacade.findStoreNewsDashbroad();
}
private List<StoreNews> storeNewsList;
public List<StoreNews> getStoreNewsList() {
return storeNewsList;
}
public void selectAllNews(){
for(StoreNews sn:storeNewsList){
sn.setCmsCheck(true);
}
infoMessage("check all store news");
}
希望你們能幫助我,謝謝!
因此,**發生了什麼......網絡響應如何,服務器上的列表是什麼樣子,當它再次被檢索時......除了指出「不起作用」之外,還有很多事情需要調查' – Kukeltje
對不起,列表的第一個條件是所有的列表都沒有勾選,然後我想當我點擊選擇所有按鈕時,列表轉到檢查。那是男人。 –