aspose file tools
The moose likes JSF and the fly likes This has to be the strangest thing... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "This has to be the strangest thing..." Watch "This has to be the strangest thing..." New topic
Author

This has to be the strangest thing...

Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

Ok, this is so strange because I swear this worked before and all of a sudden, it doesn't. I mean, it worked 2 days ago. And now it has stopped. I haven't changed anything.

If I declare the value of a selectonemenu as a String when I postback to the page, the dropdown contains the selected value. If I declare the value as an Integer, it defaults back to the first one in the list. Here is the example...





Now, if you go in and change the type for choose to String, it works. Otherwise it won't. I can probably use a converter if I need to or something, but I don't understand why 2 days ago it worked and now it doesn't. Can anyone else confirm that it does or does not work? I asummed JSF had auto conversion for basic types (Long, Integer, String, etc). I may be wrong and it may have been working all along when it really should'nt have.

Thanks.
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400

I am not sure, but I think the type (Integer, String) wouldn't matter unless these two Objects are of same type.

Are you getting the error while submitting the page?


- Varun
Vladimir Bezugliy
Ranch Hand

Joined: Sep 29, 2004
Posts: 33
Try add <h:messages> on your page :-)

You should either use

or

[ March 16, 2005: Message edited by: Vladimir Bezugliy ]
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230



Yeah, that was it. I need sleep.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: This has to be the strangest thing...
 
Similar Threads
problem when working with selectOneListbox
How to use ValueChangeLister attribute in selectOnemenu
f:selectItems can't set value
Row Actions on DataTable
selectOneMenu from database