1 Reply Latest reply on May 27, 2011 5:05 AM by snaker

    How to get selected  value from combobox?

    er.viveksrivastava

      When i select value from combobox .

      How to get selected  value of GC Format  and Win Connect  in handler .

       

       

       

       

      <h:selectOneMenu

                                      style="margin-right:200px;" id="fileFormat1"

                                          name="opttwo2" onchange="changeFormat()">

                                          <f:selectItem itemLabel="GC Format" itemValue="1"></f:selectItem>

                                          <f:selectItem itemLabel="Win Connect" itemValue="2"></f:selectItem>

                                          <a4j:support ajaxSingle="true" action="#{country.check}" event="onchange"  reRender="fileTable"> 

                                       </a4j:support> 

                                      </h:selectOneMenu>

        • 1. Re: How to get selected  value from combobox?
          snaker

          <h:selectOneMenu style="margin-right:200px;" id="fileFormat1" name="opttwo2" onchange="changeFormat()" value="#{country.value}">

           

           

          and in bean Country you must create the variable "value"

           

          private String value; with his getter and setter

           

          and with  <a4j:support ajaxSingle="true" action="#{country.check}" event="onchange"  reRender="fileTable"> 

                                           </a4j:support>

          you can use the variable "value" inside function "check"

           

          Is this you want?