Please try to send your mails to the mailing list
users_at_myfaces.apache.org too. I´m not sure if know the right
answers. So give the other users a chance.

How do you convert the date instance into a string instance to be used
for h:outputText?
It is possible that you have to take care for the timezone. Try using
java.text.DateFormat.getDateInstance(style, locale) which gives you
the right DateFormat instance for a given locale. You can call
DateFormat.setTimeZone(timezone) to provide the timezone before you
format the date into a string. You can also define a timezone for
t:inputDate which will be used for the dates the user enters.

2005/10/19, Maxence Dewil <[EMAIL PROTECTED]>:
> It's a master-detail navigation.
>
> The component rendering the date in the master datatable is a simple 
> h:outputText (the date of the previous day is rendered).
>
> The component used to edit the date in the detail page is a t:inputDate (the 
> date is rendered correctly)
>
> Regards.
>
> Maxence Dewil.
>
> -----Message d'origine-----
> De: Mathias Brökelmann [mailto:[EMAIL PROTECTED]
> Envoyé: mercredi 19 octobre 2005 15:23
> À: Maxence Dewil; MyFaces Discussion
> Objet: Re: Validation of inter-dependent fields
>
> 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
>
>


--
Mathias

Reply via email to