Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020021Openbravo ERPB. User interfacepublic2012-03-14 13:052012-05-28 09:36
dbaz 
AugustoMauch 
highminoralways
closedfixed 
5
 
3.0MP12 
Core
No
0020021: Text, Number, Date and DateTime inputs should not allow enter more characters than allowed
Text, Number, Date and DateTime inputs should not allow enter more characters than allowed, in both grid and form view.
Test in Openbravo each kind of fields, and notice, that, for example, in form view, you can enter as much characters as you want in a text input.

If you enter more characters than defined in ad_column.length, an error message bar is shown telling that the save can not be done. That is wrong (in terms of UX), the input shouln't allow enter more characters
Add a length property (taken from ad_column.length) to the mentioned references.

NOTE: Combos, selectors, ... should NOT have this restriction.
No tags attached.
has duplicate defect 0018822 closed marvintm Data is truncated instead of being validated if its size is greater than the field length 
diff issue20021.diff (3,379) 2012-04-24 17:43
https://issues.openbravo.com/file_download.php?file_id=5166&type=bug
Issue History
2012-03-14 13:05dbazNew Issue
2012-03-14 13:05dbazAssigned To => AugustoMauch
2012-03-14 13:05dbazModules => Core
2012-04-20 10:06AugustoMauchRelationship addedrelated to 0018822
2012-04-23 12:40AugustoMauchRelationship replacedhas duplicate 0018822
2012-04-24 14:31AugustoMauchNote Added: 0047915
2012-04-24 14:34dbazNote Added: 0047916
2012-04-24 17:43AugustoMauchFile Added: issue20021.diff
2012-05-03 13:01hgbotCheckin
2012-05-03 13:01hgbotNote Added: 0048322
2012-05-03 13:01hgbotStatusnew => resolved
2012-05-03 13:01hgbotResolutionopen => fixed
2012-05-03 13:01hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/2062dd7f2e7b81350aecf0ff89a64f2f7b287060 [^]
2012-05-03 13:07AugustoMauchNote Added: 0048323
2012-05-03 13:09AugustoMauchNote Added: 0048324
2012-05-25 12:09hudsonbotCheckin
2012-05-25 12:09hudsonbotNote Added: 0049001
2012-05-28 09:36guilleaerNote Added: 0049334
2012-05-28 09:36guilleaerStatusresolved => closed
2012-05-28 09:36guilleaerFixed in Version => 3.0MP12

Notes
(0047915)
AugustoMauch   
2012-04-24 14:31   
I think this approach should not be applied to number fields.

For example, if a number field has a column length of 5, it should be possible to enter '=1000-200', because the result is '800'. With the new restriction, the user would not be able to enter more text after '=1000'.
(0047916)
dbaz   
2012-04-24 14:34   
Fully agree. Don't apply it to number fields
(0048322)
hgbot   
2012-05-03 13:01   
Repository: erp/devel/pi
Changeset: 2062dd7f2e7b81350aecf0ff89a64f2f7b287060
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 03 12:46:32 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/2062dd7f2e7b81350aecf0ff89a64f2f7b287060 [^]

Fixes issue 20021: Text and date field use length property

The length property has been added to the form items of text and date fields. It has not been added to numeric fields, because it would have interfered with the ability to enter expressions.
For date fields, the length propertly is applied to its textField attribute.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/DateUIDefinition.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/StringUIDefinition.java
---
(0048323)
AugustoMauch   
2012-05-03 13:07   
Test plan: check that text and dates fields are using the length property in the form view (the behaviour in the grid view should not have been modified).
In example:
- Create a new sales order
- Try to enter more than 30 characters in the Document No. field
- Try to enter more than 10 characters (i.e. 01-02-20131) in the Order Date field.

- Create a new unit of measure
- Try to enter more than 2 characters in the EDI Code field.
(0048324)
AugustoMauch   
2012-05-03 13:09   
I think this issue is not risky.

No existing values will be truncated, because it is not possible to enter in a database a value longer than its column length, which is the property being used to set the length property of text and date fields in the form view.
(0049001)
hudsonbot   
2012-05-25 12:09   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/5401e185a8b0 [^]

Maturity status: Test
(0049334)
guilleaer   
2012-05-28 09:36   
Code reviewed and tested in pi@af4557ab55b2