我爲某些統計開發了一個接口JEE/JSF。 我創建了複選框來選擇用戶希望顯示的引用,但問題是我使用基於數據庫中的數據生成複選框Arraylist。渲染p:selectManyCheckbox有10列
我無法按照自己的意願放置它們。我想,經過10複選框,其他直接產生於線等..
我有這樣的結果
,我希望我能做到這一點
MTBFBEAN
private List<String> selectedReference = new ArrayList<String>();
private List<String> listReference = new ArrayList<String>();
private Boolean afficher = false; // Déclaration du bool pour le rendered de
// ma vue dans MTBF
@SuppressWarnings("deprecation")
public StatisticsBeanMTBF() {
this.beginDate = new Date(2001, 00, 01);
List<ProductConfModel> listtmp = this.moduleGlobal.getProductConfModels(2);
for (ProductConfModel pcm : listtmp) {
this.listReference.add(pcm.getReference());
}
}
public void mTBFByType() {
this.afficher = true;
this.listMTBF = new ArrayList<StatistiquesMTBF>();
List<StatistiquesMTBF> suspense = this.moduleGlobal.getMTBFByType(nbHeure, nbJour, NS, DAE, beginDate, endDate);
for (StatistiquesMTBF smtbf : suspense) {
for (String s : this.selectedReference) {
if (smtbf.getReference().equals(s)) {
this.listMTBF.add(smtbf);
}
JSF XHTML
<h:outputText value="Date début :* " />
<p:calendar value="#{statisticsBeanMTBF.beginDate}"
navigator="true" required="true" />
<h:outputText value="Date fin:* " />
<p:calendar value="#{statisticsBeanMTBF.endDate}" navigator="true"
required="true" />
</h:panelGrid>
<h:panelGrid columns="1">
<h:outputText value="Selectionner votre référence : " />
<p:selectManyCheckbox id="grid" columns="5"
value="#{statisticsBeanMTBF.selectedReference}">
<f:selectItems value="#{statisticsBeanMTBF.listReference}" />
</p:selectManyCheckbox>
</h:panelGrid>
<p:separator />
如果任何人都可以幫助我,那就太好了。
謝謝!
你好,謝謝你的幫助,但我是4.0 primefaces,你的標籤
Sars
您使用PrimeFaces的事實並不意味着您不能使用普通的JSF標籤。我也使用PF4.0,但是.. – Kuba
剛剛切換到'
',結果是一樣的! – Kuba