07c70cdf by Andreyev Oleg

Add maxLenght validation rule to the ofbiz model objects

1 parent 72c41d09
...@@ -21,6 +21,7 @@ define( ...@@ -21,6 +21,7 @@ define(
21 { 21 {
22 pattern: 'email', 22 pattern: 'email',
23 required: Base.createRequiredChecker('ofbiz/model/EmailAddress.emailAddress'), 23 required: Base.createRequiredChecker('ofbiz/model/EmailAddress.emailAddress'),
24 maxLength: 255
24 }, 25 },
25 ] 26 ]
26 }, 27 },
......
...@@ -16,7 +16,10 @@ define( ...@@ -16,7 +16,10 @@ define(
16 }, 16 },
17 validation: { 17 validation: {
18 groupName: [ 18 groupName: [
19 Base.createRequiredValidator('ofbiz/model/PartyGroup.groupName'), 19 {
20 required: Base.createRequiredValidator('ofbiz/model/PartyGroup.groupName'),
21 maxLength: 100
22 }
20 ], 23 ],
21 }, 24 },
22 }); 25 });
......
...@@ -17,10 +17,16 @@ define( ...@@ -17,10 +17,16 @@ define(
17 }, 17 },
18 validation: { 18 validation: {
19 firstName: [ 19 firstName: [
20 Base.createRequiredValidator('ofbiz/model/Person.firstName'), 20 {
21 required: Base.createRequiredValidator('ofbiz/model/Person.firstName'),
22 maxLength: 100
23 }
21 ], 24 ],
22 lastName: [ 25 lastName: [
23 Base.createRequiredValidator('ofbiz/model/Person.lastName'), 26 {
27 required: Base.createRequiredValidator('ofbiz/model/Person.lastName'),
28 maxLength: 100
29 }
24 ], 30 ],
25 }, 31 },
26 }); 32 });
......
...@@ -18,13 +18,22 @@ define( ...@@ -18,13 +18,22 @@ define(
18 }, 18 },
19 validation: { 19 validation: {
20 address1: [ 20 address1: [
21 Base.createRequiredValidator('ofbiz/model/PostalAddress.address1'), 21 {
22 required: Base.createRequiredValidator('ofbiz/model/PostalAddress.address1'),
23 maxLength: 255
24 }
22 ], 25 ],
23 city: [ 26 city: [
24 Base.createRequiredValidator('ofbiz/model/PostalAddress.city'), 27 {
28 required: Base.createRequiredValidator('ofbiz/model/PostalAddress.city'),
29 maxLength: 100
30 }
25 ], 31 ],
26 postalCode: [ 32 postalCode: [
27 Base.createRequiredValidator('ofbiz/model/PostalAddress.postalCode'), 33 {
34 required: Base.createRequiredValidator('ofbiz/model/PostalAddress.postalCode'),
35 maxLength: 5
36 }
28 ], 37 ],
29 } 38 }
30 }); 39 });
......
...@@ -16,7 +16,10 @@ define( ...@@ -16,7 +16,10 @@ define(
16 }, 16 },
17 validation: { 17 validation: {
18 contactNumber: [ 18 contactNumber: [
19 Base.createRequiredValidator('ofbiz/model/TelecomNumber.contactNumber'), 19 {
20 required: Base.createRequiredValidator('ofbiz/model/TelecomNumber.contactNumber'),
21 maxLength: 60
22 }
20 ] 23 ]
21 } 24 }
22 }); 25 });
......