2 Replies Latest reply on Jul 2, 2010 5:11 AM by nbelaevski

    Selected value of ComboBox in JavaScript

    satyakatti

      Hello All,

       

      I have a rich:comboBox which shows the names of JFree charts to be streamed.

       

      I would like to get the name of selected chart in JavaScript function and send to it servlet which handles the streaming of image.

       

      Could you let me know how to get selected comboBox value in Javascript function

       

      Regards,
      Satya

        • 1. Re: Selected value of ComboBox in JavaScript
          satyakatti

          Hmmmmmm finally I switched to  h:selectOneMenu so that JS function can be called and also get the value of selected item in JS.

           

          I would really appreciate if somebody tells how the selected value of h:selectOneMenu can be obtained in JSF (not in JS) coz my requirement is to

           

          pass the selected value to servlet URL for chart display.

           

          With above method I was able to display chart by calling window.open() of JS. and I could pass the value along with URL, but by this way another window opens up, which i dont want to happen. Now would like to show chart on a modal panel.

           

          So for this reason I would like to build the URL of h:graphicImage dynamically after selecting the h:selectOneMenu.

           

          Could anybody tell me how to read that selected value of h:selectOneMenu and paste it to the src/url/value of img tag or h:graphicImage

           

          Regards,

          Satya

          • 2. Re: Selected value of ComboBox in JavaScript
            nbelaevski

            Hi,

             

            Bind selection value to the model bean property via "value" attribute & EL-expression.