1.

When I Have Only A Single Record, Why Does Not It Appear In My Datagrid?

Answer»

This is a KNOWN issue that is caused by the inability of Flex to DIFFERENTIATE between an object and an ARRAY with a single row. The solution is to ALWAYS use TOARRAY(), as in the following examples:

In MXML:
{mx.utils.ArrayUtil.toArray(modelAccidents1.accidents.accident)}

The inline format:
dataProvider={mx.utils.ArrayUtil.toArray(testSrv.result.result.error)}

In ActionScript:
myControl.dataProvider = mx.utils.ArrayUtil.toArray(testSrv.result.result.error)

This is a known issue that is caused by the inability of Flex to differentiate between an object and an array with a single row. The solution is to always use toArray(), as in the following examples:

In MXML:
{mx.utils.ArrayUtil.toArray(modelAccidents1.accidents.accident)}

The inline format:
dataProvider={mx.utils.ArrayUtil.toArray(testSrv.result.result.error)}

In ActionScript:
myControl.dataProvider = mx.utils.ArrayUtil.toArray(testSrv.result.result.error)



Discussion

No Comment Found