@ManagedBean(name = "menuCtrl")
@ApplicationScoped
public class MenuControleur extends AbstractControleur implements Serializable {
private static final Logger log = Logger.getLogger(ApplicationControleur.class);
private PanierBeans[] selectedRep;
public PanierBeans[] getSelectedRep() {
return selectedRep;
}
public void setSelectedRep(PanierBeans[] selectedRep) {
this.selectedRep = selectedRep;
}
// cache
private List<Spectacle> spectacles;
private List<Representation> representations;
private Spectacle specSelec = new Spectacle();
private List<Artiste> artistes;
private List<Representation> representationsFiltrees;
private List lignesSelec;
public List getLignesSelec() {
return lignesSelec;
}
public void setLignesSelec(List lignesSelec) {
this.lignesSelec = lignesSelec;
}
在 facelet 我有这张桌子
<p:dataTable id="dataTable" var="rep" value="#{menuCtrl.specSelec.representations}" widgetVar="representationsTable"
emptyMessage="Pas de représentation trouvée avec les criteres précisés" filteredValue="#{menuCtrl.representationsFiltrees}" paginator="true" rows="10"
style="background: none" >
<f:facet name="header">
<p:outputPanel>
<h:outputText value="Search all fields:" />
<p:inputText id="globalFilter" onkeyup="representationsTable.filter()" style="width:150px" />
</p:outputPanel>
</f:facet>
<p:column id="photoArtiste" headerText="Artiste" >
<ui:param name="imgPath" value="images:#{menuCtrl.specSelec.artiste.lienPhoto}.png" />
<p:graphicImage value="#{resource[imgPath]}" />
</p:column>
<p:column id="nomArtiste" filterBy="#{rep}"
headerText="Artiste"
filterMatchMode="contains">
<h:outputText value="#{menuCtrl.specSelec.artiste.nom}" />
</p:column>
<p:column id="nomSpectacle" filterBy="#{rep}"
headerText="Spectacle"
filterMatchMode="contains">
<h:outputText value="#{menuCtrl.specSelec.nomSpectacle}" />
</p:column>
<p:column id="addColumn" filterBy="#{rep.adresse}"
headerText="Ville" footerText="contains"
filterMatchMode="contains">
<h:outputText value="#{rep.salle.adresseSalle}" />
</p:column>
<p:column id="dateDebutColumn" headerText="Date" footerText="startsWith">
<h:outputText value="#{rep.dateDebut}"
id="popupDate">
<f:convertDateTime pattern="d/M/yyyy" />
</h:outputText>
</p:column>
<p:column id="dispColumn"
headerText="Disponibilité">
<p:inputText id="champDisBillets" value="100" size="5" readonly="true" />
</p:column>
<p:column id="qteBillets"
headerText="Qte Billets">
<p:selectOneMenu value="#{buttonBean.number}">
<f:selectItem itemLabel="1" itemValue="1" />
<f:selectItem itemLabel="2" itemValue="2" />
<f:selectItem itemLabel="3" itemValue="3" />
<f:selectItem itemLabel="4" itemValue="4" />
<f:selectItem itemLabel="5" itemValue="5" />
<f:selectItem itemLabel="6" itemValue="6" />
</p:selectOneMenu>
</p:column>
<p:calendar value="#{calendarBean.date2}" id="popupCal" />
<p:column id="priceColumn" filterBy="#{rep}"
headerText="Prix" footerText="contains"
filterMatchMode="contains">
<p:inputText id="prixBillets" value="#{rep.prix}" readonly="true" size="5"/>
</p:column>
</p:dataTable>
名义上我想添加复选框,但在这种情况下,我必须添加一个指向托管 bean 属性之一的选择属性,事情是行填充了不同的对象 inds 那么选择对象应该是什么类型?