This is how I¹m retrieving data. I¹m not sure how or where to define the
Date() property. What I would like to maintain is a single call to the
required table and have all data returned.
MXML:
<mx:RemoteObject id="myservice" source="WorkingDemo" destination="amfphp"
fault="faultHandler(event)" showBusyCursor="true"> <mx:method
name="getUsers" result="resultHandler(event)" fault="faultHandler(event)">
</mx:method> </mx:RemoteObject>
...
private function faultHandler(event:FaultEvent):void {
Alert.show(event.fault.faultString, event.fault.faultCode.toString());
} private function resultHandler(event:ResultEvent):void { dp=new
ArrayCollection(ArrayUtil.toArray(event.result)); }
ServicesConfig.xml:
<services-config> <services> <service
id="amfphp-flashremoting-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">
<destination id="amfphp"> <channels>
<channel ref="my-amfphp"/> </channels>
<properties> <source>*</source>
</properties> </destination> </service> </services>
<channels> <channel-definition id="my-amfphp"
class="mx.messaging.channels.AMFChannel"> <endpoint
url="/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition> </channels> </services-config>
PHP Script:
...
function getUsers() {
# Return a list of all the users
if ([EMAIL PROTECTED]>mysqli->query("SELECT * from dbTable")) {
$errno=$this->mysqli->errno;
$this->mysqli->close();
trigger_error("AMFPHP Remoting 'sample' class database SELECT
query error: " . $errno);
}
while ($row = $result->fetch_assoc()) {
$user_array[] = $row;
}
return($user_array);
}
Thanks,
--
Blair
From: Tim Hoff <[EMAIL PROTECTED]>
Reply-To: <[email protected]>
Date: Thu, 23 Oct 2008 19:30:02 -0000
To: <[email protected]>
Subject: [flexcoders] Re: Help: filterFunction and Dates
OK, so what you're saying is that item.Date_Collected is a string
(2008-10-01) and not a date. This goes back to the original suggestion,
use a Date() type for that variable in the VO. If you do, then the last
sample should work; using selectedDate.
-TH