aspose file tools
The moose likes JSF and the fly likes Validation Error: Value is not valid Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Validation Error: Value is not valid" Watch "Validation Error: Value is not valid" New topic
Author

Validation Error: Value is not valid

Arpitha Pasnoor
Greenhorn

Joined: Mar 24, 2009
Posts: 1
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
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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.


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
Sumeet Singh Aryan
Ranch Hand

Joined: Jul 30, 2008
Posts: 43
hi
Try to change the scope of your managed bean from request to session


The woods are lovely, dark and deep, But I have promises to keep; And miles to go before I sleep, And miles to go before I sleep. - Robert Frost
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Validation Error: Value is not valid
 
Similar Threads
Null Pointer in struts
How to auto-render a GUI using Ajax
jQuery-How to highlight invalid input field value after getting validation error
Radio Buttons
Operations between two select boxes