File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error binding a h:selectOneMenu to a LinkedList

 
Todd Patrick
Ranch Hand
Posts: 31
Android Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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?
 
Todd Patrick
Ranch Hand
Posts: 31
Android Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 85
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
Android Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic