Well, if I make the same exact call in non-Cairngorm it works fine. If you want, I can post the code of the non-cairngorm solution that works right now. Either it’s something specific to binding in this manor or somehow the modelLocator change is being taken wrong…..but remember this is only for the chart – the datagrid (and they’re mapped to the same data) works fine…..and only for a non-hard coded xml file.

I haven’t had the time to check if it’s only HTTPServices…but my guess is if it’s working fine with a hard xml file (dummy.xml) and not with the cfm file (sales.cfm – which I can post also, just outputs a mime-type of text/xml….as far as I can see, it’s the exact same – even with a comparison tool) then it might be something entirely different (maybe the xml parser or the binding events).


Either way, it’s totally weird because all I change is from a hard-coded file to a cfm that produces the exact same thing (but takes 1 second) and it breaks the charts. So yeah, can’t narrow down yet because I’ve got no idea why it’s doing this
J If anyone wants any debugging output or anything from me (since that cfm isn’t accessible outside the intranet), or the code of the non-cairngorm working one just ask.

Any help would be *greatly* appreciated.

_________________________________________

Jonathan Miranda

Flexible Master of the Web

"Try not to become a man of success, but a man of value." - Albert Einstein

HealthGrades: Guiding America to Better Healthcare™

NASDAQ: HGRD

w  (720) 963-3832

c  (707) 761-0868

[EMAIL PROTECTED]

_________________________________________

The message contains confidential and/or legally privileged information and is intended for use only by the indicated addressee.  If you are not the named addressee you should not disseminate, distribute, or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmissions cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed,arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.


From: [email protected] [mailto:[email protected]] On Behalf Of Renaun Erickson
Sent: Tuesday, March 28, 2006 3:25 PM
To: [email protected]
Subject: [flexcoders] Re: Cairngorm problem

 

This does sound weird.  I haven't had time to play with the
HTTPService 1s timing issue.  But definetly something is going on.  So
we have narrowed it down to HTTPService and Binding is that correct,
not Cairngorm or other RPC services?

Renaun

--- In [email protected], "Peter Blazejewicz"
<[EMAIL PROTECTED]> wrote:
>
> Hello Jonathan,
>
> you've posted nice example so I've decided to investigate what you
> described even if i'm not very experienced dev yet,
>
> so first I wrote a simple jsp page that simply returns xml data (your
> dummy.xml is a content returned) with added Thread.sleep(....) used to
> sustain results for few seconds, Even if I changed response time to
> minimal values there was no change in dashboard behavior, charts are
> not updated with remote call, DataGrid data are correctly updated,
>
> That was strange for me because I've already ported Flex Dashboard
> sample to Cairngorm and it works fine when data is requested from
server,
> So I next moved HTTPService and onResults/onFault handlers to
> Application that way:
> <code>
> .....
>       initialize="initApp()">
>       <mx:HTTPService showBusyCursor="true"
>             id="GetSalesData"
url="" href="http://localhost:8084/dashboard/cfm/sales.jsp">http://localhost:8084/dashboard/cfm/sales.jsp"  
>             result="onResult(event)"
>             fault="onFault(event)"/>
>       <mx:Script>
>             <![CDATA[
>                   import mx.rpc.events.*;
>                   import mx.collections.*;
>                   import mx.core.Container;
>                   import mx.controls.*;
>                   import org.healthgrades.tools.*;
>                   import org.healthgrades.stats.model.ModelLocator;     
>                   import org.healthgrades.stats.control.StatsEvent;
>                  
>                   [Bindable]
>                   public var model : ModelLocator = ModelLocator.getInstance();     
>                  
>                   // Starts the 30 second timer and dispatches the EVENT_REFRESH
>                   public function initApp():void {
>                         var date:Date = new Date();
>                         model.viewingDate = date;
>                         // Need to offset the date by an hour for MTN time
>                         model.refreshTime = new Date(date.getFullYear(),
>                              
date.getMonth(),date.getDate(),date.getHours()-1,date.getMinutes(),
>                                     date.getSeconds(),date.getMilliseconds());
>                         model.timer = new Timer(30000);
>                       model.timer.addEventListener("timer", callService);
>                       model.timer.start();
>                             var seed:String = (new Date().getTime().toString());
>                         GetSalesData.send({date:"01/05/2006", rand:seed});
>                   }
>                   // Need to figure a way to bind a DataFormatter to a labelFunction
> directly to get rid of this
>                   private function formatDate(date:Date):String {
>                       return dateShortFormat.format(date);
>                   }
>                   // Called by the manual refresh button or the timer
>                   private function callService(e:Event):void {
>                         model.viewingDate = theDate2.selectedDate;
>                         var date:Date = new Date();
>                         // Need to offset the date by an hour for MTN time
>                         model.refreshTime = new Date(date.getFullYear(),
>                              
date.getMonth(),date.getDate(),date.getHours()-1,date.getMinutes(),
>                                     date.getSeconds(),date.getMilliseconds());
>                             var seed:String = (new Date().getTime().toString());
>                         GetSalesData.send({date:"01/05/2006", rand:seed});
>                   }
>                public function onResult( event : ResultEvent ) : void{
>                         var model : ModelLocator = ModelLocator.getInstance();
>                         // Set the data for the charts
>                         model.hourData = new ArrayCollection(event.result.list.hour);
>                         model.dailyData = new ArrayCollection(
> event.result.list.dailydata.value);
>                         model.hourlyData = new ArrayCollection(
> event.result.list.hourlydata.value);
>                         model.racesData = new ArrayCollection(
event.result.list.race.value);
>                         model.theTotal = new
> ArrayCollection(event.result.list.totals.amount);                       
>                         var myDateFunc : DateFunction = new DateFunction();
>                         // Using the dateAdd function to get the dates for the last 4 weeks.
>                         var dateBack:Array = new Array(5);
>                         dateBack[0] = "Current";
>                         dateBack[1] = myDateFunc.dateAdd('d',model.viewingDate,7*-1);
>                         dateBack[2] = myDateFunc.dateAdd('d',model.viewingDate,7*-2);
>                         dateBack[3] = myDateFunc.dateAdd('d',model.viewingDate,7*-3);
>                         dateBack[4] = myDateFunc.dateAdd('d',model.viewingDate,7*-4);
>                         model.theDate = new ArrayCollection(dateBack);
>                         model.theDate.refresh();
>                }
>                // if the refresh fails, stop the timer
>                public function onFault( event : FaultEvent ) : void{
>                            var model : ModelLocator = ModelLocator.getInstance();
>                         model.statusMessage = "Refresh error: Please try again later.";
>                         model.timer.stop();
>                         Alert.show(model.statusMessage,"Error",Alert.OK);                 
>                }                 
>             ]]>
>       </mx:Script>
>       <!--     
>       <business:Services id="statsServices" />
>       -->
> ....
>
> that is moving business logic into main code and there is no change,
> DataGrids data are updated but charts are not,
> with that solution I'm not using Cairngorm for data requests at all
> using basic HTTPService solution,
> I think there is rather something in bindings and Charts with that
> specific solution because as I mentioned I've already existing
> Cairngorm based sample which updates bindings without problems,
> Also Renaun mentioned bindings working fine with AMFPHP based
> Cairngorm implemenation,
>
> hth,
> kind regards,
> Peter Blazejewicz
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to