Need some help with fill() and named querys:
1) As long as I use the dataservice.fill() mehod to populate
an arraycollection with the results from a simple named query like
"SELECT * FROM Book WHERE..." I have no problems and the
arraycollection gets populated correctly. But as soon as I use a
more complex query like "SELECT l.id, b.title, c.surname,
c.telephone, c.email FROM Loan l, Book b, Customer c WHERE..." I
get a Flex runtime error that says:
ArgumentError: Items must support IManaged. See [Managed] for
more information: object: (Array)#0
[0] "2003100099"
[1] "Da Vinci code"
[2] "Jackson"
[3] "024982363"
[4] "m.jackson@hotmail.com"
at mx.data::ConcreteDataService/
http://www.adobe.com/2006/flex/mx/internal::normalize() at mx.data::DataList/
http://www.adobe.com/2006/flex/mx/internal::processSequence() at mx.data::DataList/
http://www.adobe.com/2006/flex/mx/internal::processSequenceResult() at ::DataListRequestResponder/result()
at mx.rpc::AsyncRequest/acknowledge()
at
::NetConnectionMessageResponder/NetConnectionChannel.as$40:NetConnectionMessageResponder::resultHandler()
at mx.messaging::MessageResponder/result()
This I think means that the query is executed correctly ( and
it retrieves the correct results array i.e. [0] "2003100099" [1]
"Da Vinci code" [2] "Jackson" [3] "024982363" [4]
"m.jackson@hotmail.com" ) but Flex can't use it to populate the
arraycollection: the reason is probably that it gets the data from
various sources (Loan, Book, Customer) and so the instance returned
is not one of my standard remotely managed pojos.
Riccardo