Announcement Announcement Module
Collapse
No announcement yet.
mxml with Spring Action Script Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • mxml with Spring Action Script

    We are creating an application that contains a lot of tiles or custom flex components. We are trying to use spring action script to add dependancy injection in UI side. So, is it possible to implement dependancy injection with these tiles or flex component(.mxml files) or this is possible only with .as files because we want to control addition or removal of these component with the help of xml files.

  • #2
    stage wiring

    Hi there,

    what you are refering to is called ´stage wiring´ in Spring Actionscript terms.

    Please refer to this documentation section for more information on how to get this to work:

    http://www.springactionscript.org/do...age_components

    if you have any more questions, you know where to find us

    cheers,

    Roland

    Comment


    • #3
      Actual advantage of stage component wiring

      Thanks, for your reply.

      I have gone through the document and I am little bit confused about the actual use of the stage component wiring. As far as I have studied from the document, I feels that stage wiring is basically used to provide the dependancy injection in mxml file i.e. if any mxml file is using some of the .as object, then we can provide the objects of those .as files to the .mxml file by using the spring action script architecture. So, my confusions are:

      1) is my above concept about stage wiring is right or wrong?

      2) is stage wiring is mainly used to provide only dependancies to the corresponding mxml file or we can use it as a provider of mxml in a scenario like when we try to add two or more mxml files on other one mxml file to make a composite component because if its true, then we can remove any mxml at run time from the composite component by just removing the corresponding mxml configuration from the application-context.xml file.

      Please send me your reply as soon as possible.

      Comment


      • #4
        --------------------------------------------------------------------------------

        Thanks, for your reply.

        I have gone through the document and I am little bit confused about the actual use of the stage component wiring. As far as I have studied from the document, I feels that stage wiring is basically used to provide the dependancy injection in mxml file i.e. if any mxml file is using some of the .as object, then we can provide the objects of those .as files to the .mxml file by using the spring action script architecture. So, my confusions are:

        1) is my above concept about stage wiring is right or wrong?

        2) is stage wiring is mainly used to provide only dependancies to the corresponding mxml file or we can use it as a provider of mxml in a scenario like when we try to add two or more mxml files on other one mxml file to make a composite component because if its true, then we can remove any mxml at run time from the composite component by just removing the corresponding mxml configuration from the application-context.xml file.

        Please send me your reply as soon as possible.

        Comment


        • #5
          correct

          Hey there,

          I believe your understanding of stage wiring is correct.
          So in regular circumstances you use stage wiring to inject instances into MXML objects.
          Injecting MXML children into an MXML object is possible, but with a bit of extra work.
          First and foremost, you will only be able to get this to work if you create XML object definitions for an MXML component.

          In this XML definition you will need to add method-invocation elements (doc section) that invoke the addChild method of the component.

          So roughly you definition would look like this:

          Code:
          <object id="myComponentName" class="..." scope="prototype">
           <method-invocation name="addChild">
            <arg ref="childComponent"/>
           </method-invocation>
          </object>
          
          <object id="childComponent" class="..." scope="prototype"/>
          I haven´t tried this out in a real-world application, but it should work.

          hope this helps,

          Roland

          Comment

          Working...
          X