wood burning stoves 2.0*
The moose likes JSF and the fly likes Error binding a h:selectOneMenu to a LinkedList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Error binding a h:selectOneMenu to a LinkedList " Watch "Error binding a h:selectOneMenu to a LinkedList " New topic
Author

Error binding a h:selectOneMenu to a LinkedList

Todd Patrick
Ranch Hand

Joined: Jan 30, 2004
Posts: 31

I have the following:



I am trying to populate the f:selectItems with the following code from my backing bean:



The error I keep returning is:

javax.faces.FacesException: org.apache.jasper.JasperException: Value binding '#{tb.transType}'of UISelectItems does not reference an Object of type SelectItem, SelectItem[], Collection or Map but of type : java.lang.String

How can this be a String???

I would greatly appreciate any help.

Thanks,


--Todd
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6



I'm assuming this is your class constructor? Is your class name transactionBrowserBean or should the constructor be TransactionBrowserBean? Does that make a difference at all? I think maybe your List is not being poplulated?


GenRocket - Experts at Building Test Data
Todd Patrick
Ranch Hand

Joined: Jan 30, 2004
Posts: 31

Hi Gregg:

Yes, this is my class constructor.

How would a list *not* be populated, the only way I can think of is if the constructor is not called...

Here is the entire class file:





Thanks,

--Todd
[ May 11, 2006: Message edited by: Todd Patrick ]
g madhava
Ranch Hand

Joined: Sep 14, 2001
Posts: 85
To confirm whether your constructor is getting called or not, why not put a [ System.out.println("transaction Browser bean") ] and check in the console whether it's getting printed or not.

Are you sure that the managed bean which you are referencing in the JSP page is the same as that you had configured in the "faces-config.xml" (faces configuration file) mapping to the "transactionBrowserBean" class ?
Todd Patrick
Ranch Hand

Joined: Jan 30, 2004
Posts: 31

That was it!

My mapping to the "transactionBrowserBean" class was wrong.

It should had been:



Thank you for taking a look.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error binding a h:selectOneMenu to a LinkedList
 
Similar Threads
List<SelectItem> sort
To map backing bean from a selected drop-down value
problem while setting default value for h:selectOneMenu
selectOneMenu
Problem in JSF