If you can't change the DTO in anyway you might be out of luck. There's
a couple of hacky techniques that could help if you can change the
DTO...

 

You might be able to get away with making the bindable properties
transient, so that AMF doesn't try to get / set them during
(de)serialization, and a separate set of non-bindable properties which
are used for setting up the object, both of which point to the same
private variable internally. You'd need to find some way of triggering
the binding update event once the object had been deserialized into an
AS3 object, and this is a really horrible hack...

 

Something like

 

public class Foo extends EventDispatcher {

    private var _bar : String;

    

    [transient]

    [Bindable("fooChanged")]

    public function get bar() : String {

        return _bar;

    }

    

    public function set nbBar( nbBar : String ) : void {

        _bar = nbBar;

    }

    

    public function get nbBar() : String {

        return _bar;

    }

    

    public function dispatchChangeEvent() : void {

        dispatchEvent( new Event( "fooChanged" ) );

    }

}

 

That's really horrible though...

Gregor Kiddie
Senior Developer
INPS

Tel:       01382 564343

Registered address: The Bread Factory, 1a Broughton Street, London SW8
3QJ

Registered Number: 1788577

Registered in the UK

Visit our Internet Web site at www.inps.co.uk
<blocked::http://www.inps.co.uk/> 

The information in this internet email is confidential and is intended
solely for the addressee. Access, copying or re-use of information in it
by anyone else is not authorised. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
INPS or any of its affiliates. If you are not the intended recipient
please contact [email protected]

________________________________

From: [email protected] [mailto:[email protected]] On
Behalf Of Richard Rodseth
Sent: 27 October 2009 16:09
To: [email protected]
Subject: Re: [flexcoders] Binding & Model Objects

 

  

This is consistent with the way I've done things. In my case conversion
was necessitated by needing a "dirty" flag on each record, but I also
like it philosophically.

However, in another portion of the application that I don't own, there
is a large DTO displayed in a table (with user-configurable columns),
and I don't think we can pay the price of conversion without also
implementing pagination/lazy loading.

 

Reply via email to