DEfusion (4) [Avatar] Offline
#1
I get Type Coercion errors for Note, Project & LocationVO (all pretty much the same), for notes it is as follows:

TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectProxy@18e193e9 to com.pomodo.vo.NoteVO.
at com.pomodo.command::ShowNoteCommand/result()[F:WorkPersonalflexible_railscurrentpomodoappflexcompomodocommandShowNoteCommand.as:27]
at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()[E:devflex_3_beta3sdkframeworksprojects pcsrcmx pcAsyncToken.as:204]
at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()[E:devflex_3_beta3sdkframeworksprojects pcsrcmx pceventsResultEvent.as:166]
at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:devflex_3_beta3sdkframeworksprojects pcsrcmx pcAbstractOperation.as:191]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:devflex_3_beta3sdkframeworksprojects pcsrcmx pcAbstractInvoker.as:198]
at mx.rpc::Responder/result()[E:devflex_3_beta3sdkframeworksprojects pcsrcmx pcResponder.as:48]
at mx.rpc::AsyncRequest/acknowledge()[E:devflex_3_beta3sdkframeworksprojects pcsrcmx pcAsyncRequest.as:81]
at NetConnectionMessageResponder/resultHandler()[E:devflex_3_beta3sdkframeworksprojects pcsrcmxmessagingchannelsNetConnectionChannel.as:477]
at mx.messaging::MessageResponder/result()[E:devflex_3_beta3sdkframeworksprojects pcsrcmxmessagingMessageResponder.as:206]


If I dump the event.result within the ShowNoteCommand::result method I get the following:

(Object)#0
attributes = (Object)#1
content = "Ludwig's notes"
created_at = "2008-02-06 19:16:40"
id = "875057608"
updated_at = "2008-02-06 19:22:22"
user_id = "875057608"
attributes_cache = (Object)#2

To me it looks like the remote objects aren't working as they should, but I could be wrong.

So far I've really enjoyed the book (one of the best I've read in ages). It's just a shame that I've fallen over at the point that made me read the book in the first place (I wanted a better introduction to using RubyAMF with Flex).

-D
DEfusion (4) [Avatar] Offline
#2
Re: Iteration 11 nothing works after migration to AMF
Ah-ha, my bad, sorry for that.

I hadn't restarted the server since I updated the RubyAMF config in rails so it hadn't picked up all those changes. A quick restart and everything works fine - yippie.

Really is a great book and has given me the best start of using Flex with Rails I think anything possible could (and I've been using Flex with CakePHP -- a poor rails clone) for a few months now.

Sorry for the erroneous original post.