Macromedia Flash Server - Serverside Remoting - passing Date Objects

This is Interesting: Free IT Magazines  
Home > Archive > Macromedia Flash Server > May 2005 > Serverside Remoting - passing Date Objects





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Serverside Remoting - passing Date Objects
Stefan Richter

2005-05-04, 5:45 pm

Hi,
I am trying to pass a Date Object to a CFC via SS Remoting.

var now = new Date();
trace(typeof( now )); // traces 'object' - is this correct?

When I pass this to a CFC which specifies
<cfargument name="startdate" default="" required="no" type="date">
then I receive the following error:

Service threw an exception during method invocation: The argument startdate
passed to function logChatSession() is not of type date.

Is this a known issue? Hould it work or what do I need to do to log a Date
easily to a DB?

Thanks

Stefan





=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Matt Ganz

2005-05-04, 5:45 pm

stefan -- i'm not sure about the flash side but if you're just passing
over now() then you could just as easily set that in the CFC instead of
passing it over. if you're throwing it into a DB then try putting now()
in your insert statement.

hth,

matt.

Stefan Richter wrote:

>Hi,
>I am trying to pass a Date Object to a CFC via SS Remoting.
>
>var now = new Date();
>trace(typeof( now )); // traces 'object' - is this correct?
>
>When I pass this to a CFC which specifies
><cfargument name="startdate" default="" required="no" type="date">
>then I receive the following error:
>
>Service threw an exception during method invocation: The argument startdate
>passed to function logChatSession() is not of type date.
>
>Is this a known issue? Hould it work or what do I need to do to log a Date
>easily to a DB?
>
>Thanks
>
>Stefan
>
>
>
>
>
>=-----------------------------------------------------------
>Supported by Fig Leaf Software - http://www.figleaf.com
>=-----------------------------------------------------------
>
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>
>


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Dirk Eismann

2005-05-04, 5:45 pm

Hi again,

> var now =3D new Date();
> trace(typeof( now )); // traces 'object' - is this correct?


yes - there's no "date" type in Flash.
=20
> Is this a known issue? Hould it work or what do I need to do=20
> to log a Date easily to a DB?


That's strange - when you change the argument defenition to=20

<cfargument name=3D"startdate" default=3D"" required=3D"no" =
type=3D"any">

does it work? If so: what gets transferred to CF?

Dirk.

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Stefan Richter

2005-05-04, 5:45 pm

Thanks,
You mean there's no Date in SS AS? There is one in CS Flash though that I
know of.

I'll try the 'any' approach but that's cheating ;-)


Stefan




> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of
> Dirk Eismann
> Sent: 04 May 2005 14:32
> To: FlashComm Mailing List
> Subject: RE: [FlashComm] Serverside Remoting - passing Date Objects
>
> Hi again,
>
>
> yes - there's no "date" type in Flash.
>
> do to log a
>
> That's strange - when you change the argument defenition to
>
> <cfargument name="startdate" default="" required="no" type="any">
>
> does it work? If so: what gets transferred to CF?
>
> Dirk.
>
> =---------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =---------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>



=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Stefan Richter

2005-05-04, 5:45 pm

Thanks Matt,
My example was simplified. I need to store the 'now' date in a SO slot for a
while and later save it to the DB. Therefore I can't do the Date inside
CFC/SQL.

Thanks though

Stefan



> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of
> Matt Ganz
> Sent: 04 May 2005 14:33
> To: FlashComm Mailing List
> Subject: Re: [FlashComm] Serverside Remoting - passing Date Objects
>
> stefan -- i'm not sure about the flash side but if you're
> just passing over now() then you could just as easily set
> that in the CFC instead of passing it over. if you're
> throwing it into a DB then try putting now() in your insert statement.
>
> hth,
>
> matt.
>
> Stefan Richter wrote:
>
> name="startdate"
> to log a
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>



=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Bill Sanders

2005-05-04, 5:45 pm

Stefan,

I write apps all the time using the Date object in JavaScript, and
since SS AS is JavaScript, the Date object should work.

Try this on the SS:

nowDate = new Date();
rightNow = nowDate.getDate();
trace(rightNow); //Number of the month

Bill

On May 4, 2005, at 9:54 AM, Stefan Richter wrote:

> Thanks,
> You mean there's no Date in SS AS? There is one in CS Flash though
> that I
> know of.
>
> I'll try the 'any' approach but that's cheating ;-)
>
>
> Stefan
>
>
>
>
>
>
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>



=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Dirk Eismann

2005-05-04, 5:45 pm

> You mean there's no Date in SS AS? There is one in CS Flash=20
> though that I know of.=20


of course there's a Date class in SSAS, but no date primitive type (like =
string, number, boolean). This is also true for Flash MX 2004:

var d =3D new Date();
trace(d instanceof Date);
--> true
trace(typeof d)
--> object

Dirk.

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Stefan Richter

2005-05-04, 5:45 pm

Cheating worked :-)

If I set the type to 'string' in the CFC then I get this:
{ts '2005-05-04 10:21:29'} // the value of 'now' once received by CFC

I guess this could be converted to a date once inserted into a DB?

Stefan



> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of
> Stefan Richter
> Sent: 04 May 2005 14:55
> To: 'FlashComm Mailing List'
> Subject: RE: [FlashComm] Serverside Remoting - passing Date Objects
>
> Thanks,
> You mean there's no Date in SS AS? There is one in CS Flash
> though that I know of.
>
> I'll try the 'any' approach but that's cheating ;-)
>
>
> Stefan
>
>
>
>
>
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>



=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Sean Moran

2005-05-04, 5:45 pm


Stefan,

That is the perfect format for a database DATETIME field, if you want
to keep the time.


On May 4, 2005, at 9:25 AM, Stefan Richter wrote:

>
> Cheating worked :-)
>
> If I set the type to 'string' in the CFC then I get this:
> {ts '2005-05-04 10:21:29'} // the value of 'now' once received by CFC
>
> I guess this could be converted to a date once inserted into a DB?
>
> Stefan
>
>
>
>
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>



=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com