views:

544

answers:

2

I have previously used DTO in Flex which is mapped to a PHP DTO file. I used PHP through remoteobject (AMFPHP) to retrieve info from a MySQL database which is converted into the DTO type and then passed back to Flex to populate Datagrid.

The data used to populate the Datagrid is an ArrayCollection of DataVO, as follows.

Public Function OnResult(event:Object):void{

accountingdata:ArrayCollection = new ArrayCollection(ArrayUtil.toArray(event.result); ....

} I then used binding to populate a DataGrid with {accountingdata} then,

selectedItem as DataVO

The selected item on the DataGrid populates the variable selectedItem as follows.

selectedItem = event.target.selectedItem

I then populate textfields like so:

date_txtfield.text = selectedItem.date

accountno_txtfield.text = selectedItem.accountno

I have no problem with this as the data from the server side are DataVO objects as well.

However now I am trying to substitute my server side PHP scripts with Drupal contents/nodes and I am having conversion problems.

I am not knowledgable enough to convert the data retrieved from Drupal into DataVO format. I can still populate the Datagrid using the ArrayCollection but I am not able to populate the individual textfields with invididual attributes such as date, accountno etc.

As I am new to all this, could someone please provide instruction on how to do this (as detailed as possible)?

Thanks!

A: 

Perhaps you could try to have some sort of an adapter layer in PHP that translates the Drupal contet to the DTOs you currently support. That way, you don't need to handle this on the client where you might not have as much flexibility as on the server and you could resuse most of your Flex/ActionScript code.

Christophe Herreman
A: 

Hello Allen,

have you made any progress? I' facing exact the same problem.

Thanks a lot

Jörg

Jörg Gerstl