cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivelin Ivanov" <ive...@apache.org>
Subject Re: XMLForm and dates
Date Wed, 13 Nov 2002 03:37:02 GMT

Try the following:

Use a Date property with its own getter and setter for the database access.
Implement an extra property named dateString.
Then write the getter of the property to convert the Date object into String
when invoked.
Also write a setter to convert a string to a date. The Java DateFormat class
can help.
http://java.sun.com/j2se/1.3/docs/api/java/text/DateFormat.html


In your XMLForm documents refer to the dateString property, instead of the
date property.
In your Java code, use the date property.


Hope this helps.

----- Original Message -----
From: <Sylvain.Thevoz@swisscom.com>
To: <cocoon-users@xml.apache.org>
Sent: Tuesday, November 12, 2002 8:00 AM
Subject: XMLForm and dates


Hello,

I use XMLForm and I want to put the today date in a form.
The problem is that the today date has to be a String because the XMLForm
simply display the value of the Bean class attribute. If this value is not a
String, the date can't be read!
But I want to store the today date in a Date format (because I have a
timestamp format in my database).

How to store the date in a Date type and display it like a String?
How to do this??

Thank you
Sylvain

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message