actionscript 3 - Adding elements in Flex using the presentation model -
i'm refactoring flex code written developer , i'm implementing presentationmodel approach, separate out actionscript mxml. 1 of problems i've found original actionscript code adds/removes elements mxml.
what happens handler function checks model , if values correct either create or remove element view. best way presentation model ad elements view , still keep loose coupling i'm aiming for.
i thinking of using simple events presentation model dispatches , view can list passing details of element add. there solution?
thanks
stephen
if you're using presentation model, i'd assume have kind of data of needs happen. when items of sort being dynamically added/removed, make sure make data-driven easier manipulation. if want item added, add data model dataprovider of choice (list, combobox, datagroup, etc).
by doing approach, you're abstracting logic presenter view. events should used way view know when presenter has accomplished something. data can received way (and it's practice so) or can bind data within presenter dataprovider. both good, find binding cleaner , simpler.
Comments
Post a Comment