I foreward this to the mailing list. I currently don´t have an idea
why this happens. Do you use t:inputDate or a simple h:inputText?

2005/10/19, Maxence Dewil <[EMAIL PROTECTED]>:
> Mathias,
>
> Ok it works, thx for your help.
>
>
> If you have the time, I have another question:
>
> The dates of my application are rendered correctly in the UI components, 
> except in the datatables: the date '19/10/2005 00:00:00' is rendered as 
> '18/10/2005' and '19/10/2005 00:00:01' as '19/19/2005'.
>
> I don't understand this behavior.
>
> My dates are mapped to sql server datetimes via Hibernate 3 (so the 
> nanosecond part is included in each Date object).
>
>
> -----Message d'origine-----
> De: Mathias Brökelmann [mailto:[EMAIL PROTECTED]
> Envoyé: mercredi 19 octobre 2005 10:55
> À: MyFaces Discussion
> Objet: Re: Validation of inter-dependent fields
>
> define a custom validator for the second date field (must be the second).
>
> <h:inputDate id="lowerDate" value="#{yourBackinBean.lowerDate}"/>
> <h:inputDate value="#{yourBackinBean.upperDate}"
> validator="#{yourBackingBean.validateDates}"/>
>
> public class YourBackingBean
> {
>   public void validateDates(FacesContext context, UIComponent
> component, Object value) throws ValidatorException
>   {
>     UIInput lowerComponent = (UIInput)component.findComponent("lowerDate");
>     if(lowerComponent.isValid())
>     {
>       Date lowerDate = lowerComponent.getValue();
>       Date upperDate = (Date)value;
>       // compare the two dates and throw a ValidatorException with
> message if they are not valid
>     }
>   }
> }
>
>
> 2005/10/19, Maxence Dewil <[EMAIL PROTECTED]>:
> >
> >
> >
> > Hello,
> >
> >
> >
> > My application has to validate a form where a date depends on another date
> > (the first one must be < the next one), but the JSF validation is
> > component-oriented. How can I handle that in an elegant way?
> >
> >
> >
> > A solution is described here but I don't understand how to achieve it :
> > http://weblogs.java.net/blog/johnreynolds/archive/2004/07/improve_jsf_by_1.html
> > (#Validation of Inter-Dependent Fields).
> >
> >
> >
> > Regards,
> >
> >
> >
> > Maxence Dewil
>
>
> --
> Mathias
>


--
Mathias

Reply via email to