Use AD_Column.FormatPattern for Date, Time and DateTime editors

Description

None

Environment

None

Activity

Show:
Carlos Ruiz
July 27, 2018, 12:58 PM

> I would expect to see Hour 12:56. But the field displays 12our 12:56.

Yes, it sounds wrong - maybe is dropping the quote when passing

Nicolas Micoud
July 27, 2018, 3:39 PM

See org.zkoss.zul.Timebox.setFormat(String)
AFAIU, it doesn't support this kind of notation.

Carlos Ruiz
July 27, 2018, 3:50 PM

right, reading there zk doesn't support it - so it's OK to keep it just as zk

Nicolas Micoud
July 30, 2018, 1:06 PM

Hi Carlos,

The new patch adds the following :

-> show AD_Column.FormatPattern if Reference is Time
-> increase size of AD_Column.FormatPattern and PA_ReportColumn.FormatPattern from 22 to 60 (60 is the size of the column on AD_PrintFormatItem) - nb , i had to change the datatype for Oracle first
-> set FormatPattern to be translatable for AD_Column
-> add FormatPattern on AD_Field, AD_Field_Trl, AD_UserDefField, AD_InfoColumn, AD_InfoColumn_Trl
-> updated AD_Field_v and AD_Field_vt
-> initialize AD_Column_Trl.FormatPattern with values from AD_Column.FormatPattern

  • change behaviour in info window


What it don't do :

  • apply display logics for fields in AD_Field, AD_Field_Trl and AD_UserDefField. Because i don't know if the field should always be visible or if we should only make it visible only if the overwritten type is Date, Time, String....
    -> how could be read the type (Date, String, Date+Time) as it is defined on AD_Column and may be overwritten on AD_Field and AD_UserDefField (that could make lots of @AD_Ref_ID@ = xx | @AD_Ref_ID@ = yy | @AD_Column_ID<AD_Ref_ID>@ = zz)

  • check pattern consistency as i don't know where I should move the validate FormatPattern of MColumn.beforeSave (line 374) to be used by MColumn.beforeSave, MField.beforeSave and MUserField.beforeSave. (Util.java ???)


Thanks,

Nicolas

Carlos Ruiz
July 30, 2020, 2:10 PM

Hi , I tried to apply the last patch to actual core, it seems is still very close, but still have some conflicts.

The migration scripts need to be reworked because there is a new column in AD_Field_V and AD_Field_VT.

Also GridFieldVO conflicts with the new getIsAutocomplete

And the X_ I_ classes needs to be regenerated.

Would be great if you can add a pull request.

Assignee

Nicolas Micoud

Reporter

Nicolas Micoud

Labels

Tested By

None

Priority

Minor
Configure