Problème avec p:selectManyMenu
Bonjour ,
dans mon p:selectmanymenu je veux sélectionner plusieurs rubriques,et dans le deuxième je selectionne le mois,dans le troisième je sélectionne l'année, et tout cela pour remplir mon datatable,
mais le problème qui se pose quand je clique sur le boutton valider mon datatable est vide,
est ce que qu'elqu'un peut m'aider,
voici le code:
dans mon session bean:
Code:
1 2 3 4 5 6 7 8 9 10
| @Override
public List<String> Listrubrique(List<String> servicePaieList) {
Query query = null;
String sp = EclaterServicePaie(servicePaieList);
query = em.createQuery("SELECT DISTINCT a.coderub FROM PaieValoriseAgent p JOIN p.paieValoriseRubriqueses a where p.servicePaie IN".concat(sp));
return query.getResultList();
} |
dans mon controlleur :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| private String rub;
List<String> rubs = new ArrayList<String>();
public String getRub() {
return rub;
}
public void setRub(String rub) {
this.rub = rub;
}
public List<String> getRubs() {
List<String> rubrique = new ArrayList<String>();
try {
rubrique = paieValoriseRubriqueSessionBean.Listrubrique(getBaseServicesPaie());
} catch (Exception e) {
rubrique = null;
}
return rubrique;
}
public void setRubs(List<String> rubs) {
this.rubs = rubs;
} |
dans ma page web
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
| <?xml version='1.0' encoding='iso-8859-1' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
template="/resources/templates/newTemplatePage.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:elit="http://java.sun.com/jsf/composite/elit"
xmlns:opt="http://primefaces.prime.com.tr/optimus"
>
<ui:define name="menu">
<h:form>
<f:subview id="menu1">
<ui:include src="/commun/menu/leftmenu.xhtml" />
</f:subview>
</h:form>
</ui:define >
<ui:define name="contenu">
<h:form>
<p:panel id="AjoutrubPanel" styleClass="ClassePanel">
<p></p>
<p:fieldset legend="Parametres GRHRUB" toggleable="true" toggleSpeed="500" >
<table id="choixrub" border="0" cellspacing="1000px">
<tbody>
<tr>
<td width="80px" height="10px" />
<td width="40px" height="10px" >
<h:outputLabel value="Code Rubrique" />
</td>
<td width="100px">
<p:selectManyMenu style="width: 80px;" value="#{requeteRHCtrl.rub}" required="true" >
<f:selectItem itemLabel="---" itemValue="---" />
<f:selectItems var="fil" value="#{requeteRHCtrl.rubs}"
itemLabel="#{fil}" itemValue="#{fil}" />
</p:selectManyMenu >
</td>
<td width="120px" height="10px" />
<td width="70px" height="10px" >
<h:outputLabel value="Mois" />
</td>
<td width="100px">
<p:selectOneMenu style="width: 80px;" value="#{requeteRHCtrl.mois}" required="true" >
<f:selectItem itemLabel="--" itemValue="--" />
<f:selectItems var="fil" value="#{requeteRHCtrl.mois1}"
itemLabel="#{fil}" itemValue="#{fil}"/>
</p:selectOneMenu>
</td>
<td width="180px" height="10px" />
<td width="100px" height="10px" >
<h:outputLabel value="Année" />
</td>
<td width="100px">
<p:selectOneMenu style="width: 80px;" value="#{requeteRHCtrl.annee}" required="true" >
<f:selectItem itemLabel="----" itemValue="----" />
<f:selectItems var="fil" value="#{requeteRHCtrl.annee1}"
itemLabel="#{fil}" itemValue="#{fil}"/>
</p:selectOneMenu>
</td>
</tr>
</tbody>
</table>
<p></p>
<center>
<p:panel style="text-align: center; border-color: transparent;">
<p:commandButton image="ui-icon-check" value="Valider" style="width: 80px; " ajax="false" action="#{requeteRHCtrl.RechercheRubAgent()}" update="AjoutrubPanel" />
<h:outputLabel value="#{requeteRHCtrl.msgliste}" style="color:blue"/>
<p:outputPanel style="display:#{requeteRHCtrl.visibilityerreur} ">
</p:outputPanel>
</p:panel>
</center>
</p:fieldset>
<p></p>
<p:fieldset legend="La Rubrique: #{requeteRHCtrl.rub} du Mois #{requeteRHCtrl.mois}" toggleable="true" toggleSpeed="500">
<p:dataTable id="tb2" var="listRub" value="#{requeteRHCtrl.paieValoriseAgents}" paginator="true" rows="10">
<p:column>
<f:facet name="header">
<h:outputText value="Matricule" />
</f:facet>
<h:outputText value="#{listRub[0]}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Nom" />
</f:facet>
<h:outputText value="#{listRub[1]}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Prénom" />
</f:facet>
<h:outputText value="#{listRub[2]}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="GSP" />
</f:facet>
<h:outputText value="#{requeteRHCtrl.conversionGSP(listRub[3])}" />
</p:column>
<p:column>
<f:facet name="header">
Service<br/>
Paie
</f:facet>
<h:outputText value="#{listRub[4]}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Emploi" />
</f:facet>
<h:outputText value="#{listRub[5]}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Classement" />
</f:facet>
<h:outputText value="#{listRub[6]}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="BG" />
</f:facet>
<h:outputText value="#{listRub[7]}" />
</p:column>
<p:column>
<f:facet name="header">
Libellé<br/>
Rubrique
</f:facet>
<h:outputText value="#{listRub[8]}" />
</p:column>
<p:column>
<f:facet name="header">
Sens<br/>
Rubrique
</f:facet>
<h:outputText value="#{listRub[9]}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Nombre" />
</f:facet>
<h:outputText value="#{listRub[10]}" />
</p:column>
<p:column>
<f:facet name="header">
Taux<br/>
Rubrique
</f:facet>
<h:outputText value="#{listRub[11]}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Montant" />
</f:facet>
<h:outputText value="#{listRub[12]}" />
</p:column>
</p:dataTable>
</p:fieldset>
</p:panel>
<!-- <h:panelGrid columns="1">
<p:panel header="Exporter toute la liste">
<h:commandLink>
<p:graphicImage value="/resources/elit/img/excel.png" />
<p:dataExporter type="xls" target="tb2" fileName="GRHRUB" />
</h:commandLink>
</p:panel>
</h:panelGrid>
-->
</h:form>
<p></p>
<h:form>
<p:fieldset legend="Générer le fichier GRHRUB" toggleable="true" toggleSpeed="500" style="width: 800px" >
<center>
<h:outputLabel value="Fichier GRHRUB :" style="color:#06C;font-weight: bold "/>
<p:commandButton value="Générer le fichier " action="#{requeteRHCtrl.genererfichierGRHRUB()}" ajax="false" update="aa"/>
</center>
</p:fieldset>
</h:form>
</ui:define>
</ui:composition> |
problème de selectmanymenu
bonjour
voici le code de la méthode:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| public String EclaterServicePaie(List<String> servicePaieList) {
StringBuffer spBuffer = new StringBuffer("(");
int i;
for (i = 0; i < servicePaieList.size() - 1; i++) {
spBuffer.append("'").append(servicePaieList.get(i)).append("',");
}
spBuffer.append("'").append(servicePaieList.get(i)).append("')");
return spBuffer.toString();
} |
sinon est ce que qulqu'un peut proposer une autre idée pour régler mon problème
merci d'avance
problème de selectmanymenu
Bonjour
merci pour votre réponse,mon problème est que quand je selectionne une rubrique dans le selectmany menu je n'aurai pas de résultats
Merci