On Fri, 25 Jun 2004 14:38:52 +0530, Sudeep Dsouza <[EMAIL PROTECTED]> wrote:

Hi,

I am getting the following error when I use a dateField

72436 [http-8080-Processor25] ERROR org.dbforms.util.TimeUtil  -
java.text.Parse
Exception: Unparseable date: "2004-06-23"

The format of the date in dbforms is given as

<date-format>yyyy-MM-dd</date-format>

in dbforms-config.xml I presume. For newer versions, that is no longer how to do it.



And the field in dbforms is defined as

        <field name="riskCreatedOn"     fieldType="date"    size="10"/>

The field accepting the value in the JSP page is as follows

                            <db:dateField fieldName="riskCreatedOn"
                                 styleClass = "tableCell"
                                 useJsCalendar="true"
                                 jsCalendarDateFormat="yyyy-MM-dd"/>

Try something like

<db:dateField fieldName="date_field" useJsCalendar="true" size="10"
pattern="yyyy-MM-dd"  />


You can also declare patterns globally by

ApplicationResources.properties:

dbforms.pattern.date=yyyy-MM-dd


___________________from our docs__________

Many tags make use of the pattern attribute. For example,

    <dateField pattern="date"


To set values globally for each type and language, you can define dbforms.pattern.timestamp dbforms.pattern.date etc. For Example:


ApplicationResources.properties


dbforms.pattern.date=yyyy-MM-dd dbforms.pattern.timestamp=yyyy-MM-dd HH:mm

If you use the abbriviations SHORT, MEDIUM, FULL you can define them too:

dbforms.pattern.timestamp.short
dbforms.pattern.date.full.

As defaults, Dbforms is using the following if you do not specify the patterns for each field individually.

public static final int DATE_STYLE_DEFAULT = java.text.DateFormat.MEDIUM;
public static final int TIME_STYLE_DEFAULT = java.text.DateFormat.SHORT;


--
Shawn

Karma is immutable, so act accordingly!



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
DbForms Mailing List


http://www.wap-force.net/dbforms

Reply via email to