Bonjour tout le monde;
j'ai un problème de récupération de la valeur d'un selectOneMenu,normalement je procède de la même façon que pour d'autre selectOneMenu et ça marche très bien juste celle que je vous presenterai parrait toujours vide!!
fichier html
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
		xmlns:f="http://java.sun.com/jsf/core" 
		xmlns:h="http://java.sun.com/jsf/html" 
		xmlns:p="http://primefaces.org/ui"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
</h:head>
<h:body>
<h:panelGrid columns="2">
				<h:outputText value="Département :  " styleClass="csstext3"/>
				<h:selectOneMenu value="#{departementBean.choixDepartement}" >
                			<f:selectItem itemValue="" itemLabel="Select one"/>
                			<f:selectItems value="#{departementBean.departement}" var="departement" itemValue="#{departement}"/>
                			<f:ajax render="division service nom" execute="@form" listener="#{departementBean.listeDivision}" event="click"></f:ajax>
                </h:selectOneMenu>
                <h:outputText value="Division :  " styleClass="csstext3"/>  
                <h:selectOneMenu id="division" value="#{departementBean.choixDivision}" >
                			<f:selectItem itemValue="" itemLabel="Select one"/>
                			<f:selectItems value="#{departementBean.division}" var="division" itemValue="#{division}"/>
                			<f:ajax  render="service nom" execute="@form" listener="#{departementBean.listeService}" event="click"></f:ajax>
                </h:selectOneMenu>
                <h:outputText value="Service :  " styleClass="csstext3"/> 
                <h:selectOneMenu id="service" value="#{departementBean.choixService}">
                			<f:selectItem itemValue="" itemLabel="Select one"/>
                			<f:selectItems value="#{departementBean.service}" var="service" itemValue="#{service}" />
                			<f:ajax  render="nom" execute="@form" listener="#{departementBean.listeNom}" event="click"></f:ajax>
                </h:selectOneMenu>
                <h:outputText value="Nom et prénom :  " styleClass="csstext3"/>  
				<h:selectOneMenu id="nom" value="#{consultationficheBean.nomPrenom}">
                			<f:selectItem itemValue="" itemLabel="Select one"/>
                			<f:selectItems value="#{departementBean.nom}" var="nom" itemValue="#{nom}"/>
                </h:selectOneMenu>
			</h:panelGrid>
 
</h:body>
</html>
mon fichier bean
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
 
@SuppressWarnings("serial")
@Component("departementBean")
@Scope("session")
public class DepartementBean implements Serializable {
 
	private String choixDepartement;
	private String choixDivision;
	private String choixService;
 
        public void listeDivision(){
		System.out.println("listeDivision");
		System.out.println("nom du departement choisi : "+choixDepartement);;
 
	}
 
	public void listeService(){
		System.out.println("listeService");
		System.out.println("nom du division choisi : "+choixDivision);
 
	}
 
	public void listeNom(){
		System.out.println("listeNom");
		System.out.println("nom du service choisi : "+choixService);
 
	}
 
}
pour choixDepartement et choixService ça marche très bien mais choixService non