This is correct.  My Number in my as class isn't really null it is NaN.  But I 
believe that to be the actionscript equivalent to null for a number.  And yes 
when I pass that to java function that function recieves the class with a 0 for 
the Long instead of null.  
   
  Here is the output from the console of the app server.  Notice the variable 
XPos, YPos and deployed.  See how what I send in is NaN (or null)  and it is 
converted to a 0.
   
  [Flex] Deserializing AMF/HTTP request
Version: 3
  (Message #0 targetURI=null, responseURI=/2)
    (Array #0)
      [0] = (Typed Object #0 'flex.messaging.messages.RemotingMessage')
        operation = "findStoryByExample"
        source = null
        body = (Array #1)
          [0] = "2"
          [1] = (Typed Object #2 'com.routeto1.flex.media.vo.StoryVO')
            headline = "c"
            XPos = NaN
            validToDate = null
            pageDef = null
            deployedPath = ""
            validFromDate = null
            subHeadline = ""
            storyGraphic = null
            YPos = NaN
            keywords = ""
            body = ""
            source = ""
            bylineOccupation = ""
            publishedDate = null
            otherReferences = ""
            referenceId = ""
            deployed = NaN
            byline = ""
            pk = ""
            updatedByUser = null
            selected = false
            dateUpdated = null
            copyForSearch = false
            createdByUser = null
            createdByUserName = ""
            dateCreated = null
        clientId = null
        timeToLive = 0
        messageId = "A5C134A1-DC44-4514-6B85-43FE21B96CB1"
        headers = (Object #3)
          DSEndpoint = "my-amf"
        destination = "mediaDelegate"
        timestamp = 0
  [Flex] Adapter 'java-object' called 
'com.routeto1.flex.media.MediaDelegate.findS
toryByExample(java.util.Arrays$ArrayList (Collection size:2)
  [0] = 2
  [1] = com.routeto1.flex.media.vo.StoryVO
    YPos = 0
    dateUpdated = null
    XPos = 0
    byline =
    publishedDate = null
    dateCreated = null
    pageDef = null
    copyForSearch = true
    validFromDate = null
    validToDate = null
    deployedPath =
    createdByUser = null
    bylineOccupation =
    body =
    headline = c
    keywords =
    subHeadline =
    deployed = 0
    referenceId =
    pk =
    updatedByUser = null
    otherReferences =
    storyGraphic = null
    createdByUserName =
    source =
  )'
   
  Thanks
   
  Jeff
  

Douglas McCarroll <[EMAIL PROTECTED]> wrote:
          Jeff,

Let me get this clear. If I understand correctly you're passing an AS 
number hoping that it will convert to a Java Long. But your number is 
set to null, and you'd like it to convert to null on the Java type.

Is this correct?

Douglas

Jeff Krueger wrote:
> Thanks. I am not using a primitive, I am using Long. I wonder what 
> it does for those.
> 
> Jeff
>
>
> */Douglas McCarroll <[EMAIL PROTECTED]>/* wrote:
>
> Jeff,
>
> I'm not sure that this will help you find a solution, but it confirms
> that this is a known issue:
>
> http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/js/html/wwhelp.htm?href=Part1_GetStarted.html
> <http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/js/html/wwhelp.htm?href=Part1_GetStarted.html>
>
> "Primitive values cannot be set to null in Java. When passing Boolean
> and Number values from the client to a Java object, Flex
> interprets null
> values as the default for primitive types; for example, 0 for double,
> float, long, int, short, byte, \u0000 for char, and false for
> Boolean.
> Only primitive Java types get default values."
>
> Douglas
>
> -------------------------------------------------
>
> Douglas McCarroll
>
> CairngormDocs.org Webmaster
> http://www.CairngormDocs.org <http://www.cairngormdocs.org/>
>
> Flex Developer
> http://www.brightworks.com <http://www.brightworks.com/>
> 617.459.3840
>
> -------------------------------------------------
>
> Jeff Krueger wrote:
> > All,
> >
> > I am finding that when I pass a actionscript class to a remote
> > java object and a number variable type in the actionscript class is
> > set to NaN (Null), that the java class gets set to a 0, instead
> of a
> > null. Is there something I am missing or something I need to set
> the
> > number to so it will be null in my java class?
> >
> > Thanks
> >
> > Jeff
> >
> >
> > ----------------------------------------------------------
> > Access over 1 million songs - Yahoo! Music Unlimited.
> >
> <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/
> <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/>>
>
> >
> >
>
>
> ----------------------------------------------------------
> Want to start your own business? Learn how on Yahoo! Small Business. 
> <http://us.rd.yahoo.com/evt=41244/*http://smallbusiness.yahoo.com/r-index> 
>
> 



         

 
---------------------------------
Everyone is raving about the all-new Yahoo! Mail beta.

Reply via email to