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

ace:autoCompleteEntry unable to put selected item value in backing bean property

 
Zainab Haf
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am new here , kindly help in the follow issue i am facing for days.

I want to get the Value of selectItem (ItemValue which is an Integer and the Item Label is String) in my backing bean using autocompleteentry tag of icefaces 3.1.0

but i get error:

here is the code:



Bean is :



the cities has itemvalue as a number and itemLabel as String stored in it. I do get autocomplete fine and shows list of matches if i store value in some String property of backing bean but if storing in integer property of bean, gives this error as soon i write something in autocomplete.

INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=frmmaster:j_idt205:txtcity[severity=(ERROR 2), summary=(frmmaster:j_idt205:txtcity: 'a' must be a number consisting of one or more digits.), detail=(frmmaster:j_idt205:txtcity: 'a' must be a number between -2147483648 and 2147483647 Example: 9346)]


Thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17616
38
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you are trying to permit people to type in a city name but have it resolve to a numeric city ID. The user typed in "a", and since that's not a number, the validator got annoyed.

SelectItems are value/label pairs, and presumably you want the user to type the label and have JSF set the value. Which can be a problem when you have an incomplete label that doesn't correspond to any value in the selectitem collection.

That's about as much help as I can give, since I'm not familiar with the "ace" tag library, but hopefully it will help.
 
Zainab Haf
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks that really made me understand the problem why it would not set the the value in cityID if using SlecetItem list because of incomplete entered value(Label) is not having any item value(Integer) in the list.

but i have done the same thing another way by giving a list of City class objects to this autocomplete tag instead of list of selectItems (following this tutorial icefaces Showcase)but that also didnt work as page page gets blurred out whenever i enter some character or says "internel server error" despite i m getting the correct list in getter of list<Citiy> i am using in tag. Atleast it should show the list in autocomplete even if i dont store anything in backing bean.



in bean Class added this property:



 
Tim Holloway
Saloon Keeper
Pie
Posts: 17616
38
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, that requires more knowledge of IceFaces than I currently have at my fingertips.

One thing, though. Your display name doesn't conform to our naming requirements (http://www.javaranch.com/name.jsp). I recommend you repair it before one of the enforcement-type people take notice.
 
Zainab Haf
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thankyou and i will change name.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic