2 Replies Latest reply on Sep 13, 2007 9:10 AM by Robert_Csiki

    Very odd behavior regarding variable naming with DataService.fill()

    Robert_Csiki
      I'm experiencing this odd behavior in LCDS 2.5, wich pertains to variable naming for the objects returned by a DataService.fill() call. I ceated a simple destination with a Java adapter. the Server side Java data object is defined as follows)

      package test;

      public class RepositoryObject
      {
      private String m_strObjectId;
      private boolean m_bIsValid;
      private long m_lSize;

      [public setters and getters here]
      }

      On Flex side, the ActionScript value object is defined as follows:

      package test
      {
      [Bindable]
      [RemoteClass(alias="test.RepositoryObject")]
      public class RepositoryObject
      {

      public var m_strObjectId:String;
      public var m_bIsValid:Boolean;
      public var m_lSize:Number;

      public function RepositoryObject()
      {
      }

      }
      }

      The FDS destination definition (in data-management-config.xml):

      <destination id="testDs">

      <adapter ref="java-dao" />

      <properties>

      <source>test.TestDS</source>
      <scope>application</scope>

      <metadata>
      <identity property="m_strObjectId"/>
      </metadata>

      <network>
      <session-timeout>20</session-timeout>
      <paging enabled="false" pageSize="10" />
      <throttle-inbound policy="ERROR" max-frequency="500"/>
      <throttle-outbound policy="REPLACE" max-frequency="500"/>
      </network>

      <server>
      <fill-method>
      <name>getObjects</name>
      </fill-method>
      </server>
      </properties>
      </destination>

      What I figured while debugging into the client was is the data returned by the service (I'm using the mx:DataService call) returns objects whose variable names do not match my definition:

      m_strObjectId becomes objectId
      m_lSize becomes size
      m_bIsValid becomes isValid

      I wonder why that renaming??? Basically "m_str" prefix was stripped and capital "O" became lower case "o" for my first variable etc.

      For instance, in a datagrid cell renderer I could not reference the returned value as {data.m_strObjectId}, but if I use {data.objectId}, it works.

      Any ideas why this behavior (which I found confusing and odd) would be greately appreciated.
      Robert