This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
1 Replies Last post: Dec 21, 2007 3:49 PM by Tatyana Matveyeva  
Krashan Brahmanjara   18 posts since
Nov 30, 2007
Currently Being Moderated

Dec 21, 2007 12:10 PM

Quick transform h:selectOneMenu to q:dropDownField?

Hi

 

What is the best method of transform of this case?

 

h:selectOneMenu  value=Integer

  f:selectItems value=List of javax.faces.model.SelectItem(Integer,String,String)

 

to

 

q:dropDownField   value=Integer converter=()

  q:dropDownItems  value=List of javax.faces.model.SelectItem(Integer,String,String)

 

For now q:dropDownItems do not support List of SelectItem's so I use converter Integer<>SelectItem but usage of  objectToString is very intensive and not neccesery.

 

Is any better method?

Tatyana Matveyeva   873 posts since
Aug 16, 2006
Currently Being Moderated
1. Dec 21, 2007 3:49 PM in response to: Krashan Brahmanjara
Re: Quick transform h:selectOneMenu to q:dropDownField?

Krashan,

 

Actually, the purpose of the DropDownField component is a different from the SelectOneMenu. The SelectOneMenu component is a select component, the user can only select one of the predefined values. The DropDownField component is an input component where the user can either type in a value or select one of the values from an attached drop-down list. The user can type not only the value from the predefined list, but any value.

 

We are going to add new component that will be extended SelectOneMenu (ComboBox) component in one of the future releases.

 

Regarding your question. Yes, you are right. Since the DropDownField component is an input component, not a select component, you have to use a converter. There is no any other ways to use the DropDownField component with SelectItems.

 

Regards,

Tatyana

More Like This

  • Retrieving data ...