Hello Mario,

if you get a 'Value is not a valid option' Validation Error I know two
reasons.

1. The default TimeZone for DateConverter is GMT.

2. The UISelectOne Component validate the converted Value with the list
of SelectItems values. The values of the SelectItems should be a Date.

Just added a SelectOneChoice date example to tobago-example-test

http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/test/src/main/webapp/selectOneChoice.jsp

http://svn.apache.org/viewvc?rev=596080&view=rev

Regards


Bernd



Schröder schrieb:
> Hi everybody,
> 
>  
> 
> I'm having a tc:selectOnceChoce-component that contains a list of years as 
> string. I'd like to set a select year in the bean as a Date-Object by using a 
> converter. The converter runs without an error but the Tobago-Framework 
> throws a ValidationException. 
> 
> In the log I find this message: 2007-11-16 15:10:17 ERROR - 
> org.apache.myfaces.tobago.context.ResourceManagerImpl:292 - Path not found, 
> and no fallback. Using empty string.
> 
>  
> 
> I tried to fix the problem with my own Validator, but I still get the same 
> Problem. When I use a string instead of a date in the bean it works. But I 
> don't want a String since this will cause problems somewhere else. 
> 
> What can I do? Who can help me?
> 
>  
> 
> Partial source code:
> 
>  
> 
> ...
> 
> <tc:selectOneChoice value="#{controller.currentMedia.yearOfPubl}" id="year"
> 
>               disabled="#{not controller.editor}" >
> 
>             <f:converter converterId="books.YearListConverter" />
> 
>             <f:selectItems value="#{controller.yearList}" />
> 
> </tc:selectOneChoice>
> 
>  
> 
>  
> 
> This is the bean with the date:
> 
> ...
> 
> @Entity
> 
> public class Book extends Hardware {
> 
>             private static final long serialVersionUID = 
> -1766787777560262298L;
> 
>  
> 
>             private URL url;
> 
>             private Date yaerOfPubl;
> 
>  
> 
>             /** Creates a new instance of Book */
> 
>             public Book() {
> 
>                         super();
> 
>             }
> 
>  
> 
>             public URL getUrl() {
> 
>                         return url;
> 
>             }
> 
>  
> 
>             public void setUrl(URL url) {
> 
>                         this.url = url;
> 
>             }
> 
>  
> 
>             @Temporal(value = TemporalType.DATE)
> 
>             public Date getYearOfPubl() {
> 
>                         return yaerOfPubl;
> 
>             }
> 
>  
> 
>             public void setYearOfPubl(Date yearOfPubl) {
> 
>                         this.yaerOfPubl = yearOfPubl;
> 
>             }
> 
> }
> 
> ...
> 
>  
> 
>  
> 
> Regards,
> 
> Mario
> 
> 
> 
>  
> 
> 

Reply via email to