Announcement Announcement Module
No announcement yet.
Autopopulating from presentation model Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Autopopulating from presentation model

    I have searched for this but can't seem to find an answer. Is there a mechanism in place to auto-populate stage fields from an autowired presentation model?

    For instance, I have a Form or Panel with a TextInput field "name". I have a presentation model with a "name" property that is autowired into the component. Is there anyway to automagically wire the two fields? This would also be helpful with currentState.

    Also, I understand that this is still a work in progress, so if this is something that I can develop within the framework, please let me know.


  • #2

    there is no naming scheme for mapping properties of a UI component to properties of a presentation model. I think we could support this somehow in the framework though. (You could do this for instance by subclassing the Autowire metadata processor and adding your own logic to do the mapping.)

    The current way to go is to manually set up a binding between the text property of the Text component and the property on the presentation model.



    • #3
      Custom solution


      I came up with a "solution" that works for me, but I am not sure how well it fits into your framework. I would be happy to share the code, but I would like to just pass it along and let you edit/fix it as you see fit. Thanks for all your hard work; I truly believe that this project will become the de facto standard for Flex development soon.

      What I came up with basically two-way binds stage component properties with autowired presentation class properties based upon matching id's and property names. I believe that fits the model.

      I've also come up with a way to automatically apply security by applying metadata to those same properties. So, if an autowired property has a "Secure" tag(metadata), the processor will create an appropriate MembershipData object and attach it to the SecurityManagerFactory.

      It definitely has some non-generic code that can be refactored, but it works. Let me know if you are interested.

      Also, I am attempting to work through all of this through modules. The basics are working, but I am having some issues that I will post as a separate thread.

      Great work!