Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to know when an integer ListGrid field is going to actually be an integer

    I have a ListGrid which is client only and am using setData() to fill it with data. The user can then edit it and add rows. One of the fields in the grid is an integer. I add a row and type in a valid integer. I then call ListGrid.saveAllEdits() followed by ListGrid.getOriginalRecordList(). When I process the resulting RecordList and try to getAttributeAsInt() on the integer field I get a js error saying expected int but got String.

    I've run into this situation numerous times and have always resorted to Integer.parseInt(ListGridRecord.getAttribute(myIntegerField)). Why is it a String? The records that I supplied originally via setData() and then edited don't throw the error.
Working...
X