• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Validation Error: Value is not valid

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

As per my requirement, I have a Select One box. I need to render the UI components(input texts, select boxes, radio buttons, output texts ...) on selection of drop down value. I have action buttons like close, save etc.
I am using custom converter to validate the form for required value. I am able to validate the fields on click of save button, but the problem is whenever I change the value in Select One box it's throwing Validation Error: Value is not valid, which is not allowing user to perform other actions.

In converter class I have taken a boolean value to do validations only when save is clicked. I have not specified the converter for that select one box. When I have selected for the first time it's not calling the converter class, for second selection it's calling the converter class and throwing the above exception.

please can anybody help me out, I am deadly in need of solution.....

Thanks,
Arpitha
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have really no idea what you're talking about with "select one box". Please don't rephrase components in your own words. This makes no sense.

Let's assume that you're talking about the h:selectOneMenu component. You will get this error during the form submit when the selected item is not part of the selectitems. So basically all you need to do is that the getter of the selectitems returns exactly the same list as it did during display.
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
Try to change the scope of your managed bean from request to session
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A very bad idea. This has much more impact on the code logic and the user experience.

Request scoped data belongs in the request scope. Session scoped data belongs in the session scope. Application scoped data belongs in the application scope. Simple as that. Do not put request scoped data in the session scope. Suggesting to split the list of items into a session or application scoped bean would be a better idea.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic