The default behavior of the DateTimeConverter is to use GMT if no
Timezone is specified. This is since 22/Sep/05 because of the jsf spec.

Also showing the Date only is default behavior, if you want to show the
time also you need to specify a pattern or a type to the converter.



Maxence Dewil wrote:
> I should be more accurate: 
> 
> If I use a f:convertDateTime or not, the result is the same.
> 
> The libs are from the 18/10/2005 nightly build. With an older build 
> (20/09/2005) it works. So I think a change happened on the datatable 
> implementation.
> 
> I know, I'm using a nightly build.. but I cannot reach the server to download 
> the current release :-(
> 
> Regards.
> 
> Maxence Dewil.
> 
> -----Message d'origine-----
> De : Mathias Brökelmann [mailto:[EMAIL PROTECTED] 
> Envoyé : mercredi 19 octobre 2005 16:02
> À : MyFaces Discussion; Maxence Dewil
> Objet : Re: Validation of inter-dependent fields
> 
> 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
> 

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.

Reply via email to