2 Replies Latest reply on Feb 24, 2009 1:03 PM by Felix Sima

    Getting the value of the parent tag of <a4j:support>

    Felix Sima Newbie

      Hello.

      I have the following JSF page:

      ...
      <h:selectOneMenu id="judet" value="#{orasBackingBean.idJudet}">
       <f:selectItem itemValue="" itemLabel="#{customMessages.alege}"/>
       <f:selectItems value="#{orasBackingBean.judete}"/>
       <a4j:support event="onchange" reRender="orase" actionListener="#{orasBackingBean.actualizeazaOrase}"/>
      </h:selectOneMenu>
      ...


      where actualizeazaOrase is a method of my backing bean:

      public void actualizeazaOrase(ActionEvent event){
      
       HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
       String judet_id = (String)request.getAttribute("judet");
       ...
      }


      How can I get the value of the select field having the id="judet" inside of my method?
      The code I used is not working, the value of judet_id is null !
      I also inspected:

      event.getComponent();
      event.getSource();

      but the value is also null!

      Which method is more appropriate to use in here? Should I get that value from FacesContext or from the ActionEvent?
      Where can I find some sample code about this? (richfaces_usersguide.pdf doesn't helped me much in here )

      Thank you,
      Felix
      Use www.jaaava.com - A Google for Java !!!