Hi:

            Could anyone tell me how to display a specified drop down
list value?  Let say will would like to display "3:Medium" instead of
other drop down value.  Please see below.  Thanks.

For example:

On the JSP:

< tc:selectOneChoice

                  value= "#{ MyClassController.myBean.probability}"

                  required= "false">

                  <f:selectItems value="#{
MyClassController.probability}" />

            </ tc:selectOneChoice >

 

On the Backing Bean:

      

public class MyClassController{

 

      private MyBean myBean;

      public SelectItem[] _probability;

 

      public SelectItem[] getProbability() {

      

            SelectItem[] selectItemArry = new SelectItem[4];

selectItemArry[0] = new SelectItem("0" , "");

            selectItemArry[1] = new SelectItem( "5", "5:High" );

            selectItemArry[2] = new SelectItem( "3", "3:Medium" );

      selectItemArry[3] = new SelectItem( "1", "1:Low" );

 

}

}

 

Public class MyBean{

      Private int probability;

       public int getProbility()      {

            Return probability;

      }

      Public void setProbility(int probility)      {

            This.Probility = probility;

      }

}

 

Reply via email to