Decimal fields

19 views
Skip to first unread message

Emiliano

unread,
Feb 16, 2015, 4:06:21 AM2/16/15
to openlega...@googlegroups.com
I noticed this: if in the AS400 file I have defined a decimal field, there are some issues in the web app.
If I map it to a Integer and its value is 4 digits or more it doesn't appear in the table. I solved this, mapping it to a String.
In edit mode, the same filed submits correctly the first time (when it was empty), but I can't modify it no more because no submit event fires.
Hope you understand what I want to say :-)

Roi Mor

unread,
Feb 16, 2015, 5:27:10 AM2/16/15
to openlega...@googlegroups.com
Please attach a trail file with an example of such a field

Emiliano

unread,
Feb 16, 2015, 5:28:56 AM2/16/15
to openlega...@googlegroups.com
PS: after my "legacy" collegue changes the filed to integer (no decimal places) I have the same issue if the value is >= 1000.

Emiliano

unread,
Feb 16, 2015, 5:38:05 AM2/16/15
to openlega...@googlegroups.com
150216_1058_94cf083b-2aef-4b7a-acff-5dae35504f7d.trail

to...@openlegacy.com

unread,
Feb 16, 2015, 6:58:45 AM2/16/15
to openlega...@googlegroups.com
Hey,

I created a demo project with the trial you provided and it seems to work fine.

I attached a screenshot of the header and the demo project.

Can you send a screenshot of the header you get and your project?

Tom
MagaDemo2.png
MagaDemo2.zip

Emiliano

unread,
Feb 16, 2015, 9:03:01 AM2/16/15
to openlega...@googlegroups.com
In a jpg you can see how I saw the column if I set the fields to String and in the other to Integer.
But the real problem is when i go in edit mode to a row: if a value > 999 is already saved, no Submit event fires.

I suspect the . and decimal places have something to do with the issue ;-)
MagaDemo.zip
string.JPG
integer.JPG
edit.JPG

to...@openlegacy.com

unread,
Feb 18, 2015, 6:51:10 AM2/18/15
to openlega...@googlegroups.com
Hey,

I ran your project.

1) Try converting all fields in OrderRows and OrderRowDetail to String, when using JSON it doesn't matter if it is a String or an Integer but it seems to cause problems in the HTML.
2) Notice that the input field doesn't get the correct value (it stay empty) although the model contain "9.000", that happens because the input have type="number" and angular can't bind the decimal value from the model to the input.

When i submitted the form, I saw in chrome Network that all the values are sent correctly, try going to "services.js" in your project then in line 52 change: data : encodeURIComponent(angular.toJson(model)) to: data : angular.toJson(model)
After that when you do Inspect Elements in chrome (f12) you can see in the Network tab the header of your POST action that contains the values of your fields.

Also, this post my help you with the decimal binding: http://stackoverflow.com/questions/19404969/angular-data-binding-input-type-number

Emiliano

unread,
Feb 18, 2015, 8:30:52 AM2/18/15
to openlega...@googlegroups.com
Hi Roi, I'm going to run more test later.

Only a clarification: no decimal value are used in this demo (only integer); here in Italy 9.000 stay for 9K (we use the , for decimal places)
Reply all
Reply to author
Forward
0 new messages