It would be the same type as what the converter returns from the
selectOneMenu control. In your case, you will need to convert Strings
to Integer so that the submitted value can be converted into the same
type as your bean field.

On 7/25/07, daniel ccss <[EMAIL PROTECTED]> wrote:
Hi all, I have a Simple question of SelectOneMenu

In my bean I have an ArrayList with Patients, that is fill with an EJB
method. Patient object have the patientId and the patientName
Now how I can display it on a SelectOneMenu??

I searched and saw something like the following code, what I didn“t
understand was: what myBean.selectedItem is, I know that
myBean.selectedItems is the ArrayList, but what is selectedItem?  Can
someone give a simple example for this simple question, thanks


JSF<h:selectOneMenu value="#{myBean.selectedItem}">
 <f:selectItems value=
"#{myBean.selectItems}" />
</h:selectOneMenu>


MyBeanprivate Integer selectedItem;
// + getter + setter

public List getSelectItems() {

 List selectItems = new ArrayList();
 selectItems.add(new SelectItem(integer1, string1);

 selectItems.add(new SelectItem(integer1, string2);
 ...
 return selectItems;

}






Reply via email to