Value Format for ZK

Description

To get the Value Format working on ZK we did the following:

  • added the jquery.maskedinput.min.js file to the project

  • changed lang-addon.xml file to include the new file

  • created a new field at AD_Column table, called cof_WFormat

  • changed the WStringEditor to apply the mask declared at cof_WFormat

if this is a good solution, I can generate a patch and the migration scripts (i need centralized ID access for this) and attach here to be reviewed.

just for reference, an old group discussion: https://groups.google.com/d/msg/idempiere/bFdyTdOAkJ4/Zo9RYZ0oKAcJ

Environment

None

Activity

Show:
Carlos Ruiz
November 29, 2014, 2:08 AM

Thank you very much for your contribution.

I'm testing and I think your issus is that basic jquery maskedinput doesn't cope with your needs (to force uppercase).

Now, I played a little with jquery.maskedinput.min.js and configured mask definitions same as swing VFormat (see lines 24 to 34 of jquery.maskedinput.min.js on my provided patch).

Swing converts to uppercase the letters, but with this library what we can do is force the usage of uppercase.

I think I remember that in swing the bad thing of using VFormat is that your values become fixed length filled with extra-spaces at the end - and I see the same issue here with the library.

Another note, I tried to use 1.4.0 of the library and it didn't work - needed to stick with 1.3.1

Another note, if the supported format we arrive is the same as swing maybe we wouldn't need a new column.

WDYT?

Regards,

Carlos Ruiz

Alan Lescano
November 29, 2014, 12:35 PM

,

You are right. If the jquery.maskedinput.min.js became compatible with the swing format, a new column is unnecessary.
I've tested using 1.4.0 (both uncompressed and min.) and seems to work fine also.

If ok, I can try to create a new patch, removing AD changes and incorporating your improvements to jquery.maskedinput.min,js 1.4.0.

Thanks

Alan

Carlos Ruiz
December 23, 2014, 9:27 PM

> If ok, I can try to create a new patch, removing AD changes and incorporating your improvements to jquery.maskedinput.min,js 1.4.0.

yes , I think is a good idea to try that approach, thanks.

Carlos Ruiz
February 26, 2015, 12:10 AM

Hi, I'm attaching a patch that works in r3 using the most recent jquery.maskedinput v1.4.1

The patch also adds VFormat to AD_Field and AD_UserDef_Field

Please test it and provide feedback for integration into r3.

I also added a new token 'U' for VFormat that allows any character except lowercases (I think it can be useful for example to captura company names) - the issue is still that the values are saved in database as fixed width - I was not able to trim trailing spaces and edit again the trimmed value.

Murilo Habermann Torquato
May 3, 2016, 3:48 AM

Hi Carlos,

The patch is working well (tested under 3.1) and it's really usefull.

I only got 4 rejections in due to comments on model classes:
? org.adempiere.base/src/org/compiere/model/I_AD_Field.java.rej
? org.adempiere.base/src/org/compiere/model/I_AD_UserDef_Field.java.rej
? org.adempiere.base/src/org/compiere/model/X_AD_Field.java.rej
? org.adempiere.base/src/org/compiere/model/X_AD_UserDef_Field.java.rej

Assignee

Carlos Ruiz

Reporter

Murilo Habermann Torquato

Labels

Tested By

None

Components

Priority

Minor
Configure