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

  • constants injection

    Hi again,

    This time I'm having troubles while trying to inject a constant value into an object ...

    First, I have a class in the default package (ok, I know, it's no good practice) anyway, here is the constant definition :
    Code:
    package  {
    	public class Notifications {
    		public static const ERROR:String = "error";
    	}
    }
    I am trying to inject the ERROR constant into a string property of an object :
    Code:
    	<object id="myObject" class="org.ozb.SomeObject" scope="singleton" autowire="byType">
    		<property name="stringValue">
    			<object class="org.springextensions.actionscript.ioc.factory.config.FieldRetrievingFactoryObject">
          				<property name="targetClass" value="Notifications"/>
          				<property name="targetField" value="ERROR"/>
        			</object>
    		</property>
    	</object>
    This way it works. But I had to use a "targetField" field property while I was expecting to use a "staticField" like written in the documentation.
    Ok, this is a minor issue.

    Now, the real issue : I'm trying to use the util namespace to achieve the same result but I can't get it to work !
    I have added the namespace definition and the namespace handler (like in doc)
    I have used the following flavors without any success :
    Code:
    <!-- DOES NOT WORK -->
    <util:constant static-field="Notifications.ERROR"/>
    <!-- DOES NOT WORK -->
    <util:constant target-class="Notifications" target-field="ERROR"/>
    <!-- DOES NOT WORK -->
    <util:constant target-class="Notifications" static-field="ERROR"/>
    I have an error at context creation.

    Help appreciated
    thanks in advance

  • #2
    Hi,

    seems like this is a bug. I've created an issue http://jira.springframework.org/brow...IONSCRIPTAS-99 and will provide a fix later this day.

    regards,
    Christophe

    Comment


    • #3
      Hi,

      this issue should be resolved now.

      Code:
      <property name="level">
        <util:constant static-field="mx.logging.LogEventLevel.DEBUG"/>
      </property>
      Let me know if you run into more problems.

      regards,
      Christophe

      Comment

      Working...
      X