how to get value from <h:h:selectOneMenu>?
i want to know how to get a value from <h:selectOneMenu>. i tryed to get it using this code : 


<h:form>
            <h:outputLabel value="départements : "/>
            <h:selectOneMenu value="#{departementController.selected.id}" onchange="submit()" immediate="true">
                <f:valueChangeListener type="Controller.Listener.DepartementValueListener"/>
                <f:selectItems value="#{departementController.itemsAvailableSelectOne}"/>
            </h:selectOneMenu>
            
            <h:outputLabel value="nouvelle valeur : "/>

            <h:inputText value="#{departementController.comboBox}" id="dep"/>
        </h:form>


public class DepartementValueListener implements ValueChangeListener{
    
    @Override
    public void processValueChange(ValueChangeEvent event)
			throws AbortProcessingException {
 
		//access departement bean directly
		DepartementController depart = (DepartementController) FacesContext.getCurrentInstance().
			getExternalContext().getSessionMap().get("dep");
 
		depart.setComboBox(event.getNewValue().toString());
 
	}
 
    
}

how to get value from <h:h:selectOneMenu>?
===

i want to know how to get a value from <h:selectOneMenu>. i tryed to get it using this code : 


<h:form>
            <h:outputLabel value="départements : "/>
            <h:selectOneMenu value="#{departementController.selected.id}" onchange="submit()" immediate="true">
                <f:valueChangeListener type="Controller.Listener.DepartementValueListener"/>
                <f:selectItems value="#{departementController.itemsAvailableSelectOne}"/>
            </h:selectOneMenu>
            
            <h:outputLabel value="nouvelle valeur : "/>

            <h:inputText value="#{departementController.comboBox}" id="dep"/>
        </h:form>


public class DepartementValueListener implements ValueChangeListener{
    
    @Override
    public void processValueChange(ValueChangeEvent event)
			throws AbortProcessingException {
 
		//access departement bean directly
		DepartementController depart = (DepartementController) FacesContext.getCurrentInstance().
			getExternalContext().getSessionMap().get("dep");
 
		depart.setComboBox(event.getNewValue().toString());
 
	}
 
    
}
