Announcement Announcement Module
Collapse
No announcement yet.
view autowire Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • view autowire

    Hi!
    thanks to Martino and Roland i managed to autowire a property on a view in a pure AS project (not flex). Just to make sure i got it right could someone confirm the following?
    - for the view to be autowired it needs to be referenced in the applicationContext (ie: the view is not automatically scanned when added to stage, it also need to be referenced in the xml context).
    - by default, if the view is referenced in the xml context, it's instantiated at parse time (up front).
    - if i want the view to be instantiated when needed (not up-front) i can use the lazy-init attribute.
    - if i want multiple instances of this view i use the scope="prototype" attribute.

    thanks!

  • #2
    confirmed

    Hi there Sitron,

    you're almost completely right in your assumptions, just for clarity sake:

    the lazy-init applies only to singleton scoped objects, by default all singletons are instantiated by the container except when they're marked as lazy-init.

    Indeed, if you want a new instance of an object after each call to getObject() you need to set its scope to "prototype".

    hope all is clear now, if you have any more questions we'd be happy to hear them.

    greetings,

    Roland

    Comment


    • #3
      thanks Roland!

      Comment

      Working...
      X