Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default refreshing data

    Hello all,

    All I would like to do is to refresh a xml model every 5 mins or so( since the
    xml file will be updated every 5 mins or so as well) I have found some exampels
    of how to do this but they where way overly complex for my simple needs. I know
    to use set interval but I'm not sure how to use that in tandem with a data
    service.

    Thanks!

    Jorge

    maxkool Guest

  2. Similar Questions and Discussions

    1. Real-time refreshing data
      Hello everybody, i have a swf file, with a simple mx:List i have to refresh this list when an user will click to a link on my website. Example:...
    2. Refreshing chart data doesnt update chart
      I must be missing something simple here. I have a column chart that is using an array for its dataprovider. However, when I update the underlying...
    3. Refreshing a page to display change in data
      I have a page that scrolls out information from a database. When one of the records has been completed by the user, they press delete at the end of...
    4. Refreshing a Page
      I have a menu that calls a specific asp page and passes a variable data1page.asp?year=2001 where the value of the year variable is determined...
    5. refreshing a checkbox
      I posted this in a google google group and havent had any luck as of yet. Maybe you guys can help me. I have a list box that gets it data from a...
  3. #2

    Default Re: refreshing data

    here is the code im trying to run below:

    i know it is something very simple, but i'm racking my brains!!

    thanks

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*"
    creationComplete="startApp()">

    <mx:Model id="crimeModel2" source="data/ticker.xml"/>
    <mx:Script>
    <![CDATA[
    function startApp()
    {
    setInterval(this,"getData",5000);
    }
    function getData() {

    crimeModel2.item();

    }
    ]]>
    </mx:Script>
    <mx:DataGrid id="output" dataProvider="{crimeModel2.item}">
    </mx:DataGrid>
    </mx:Application>

    maxkool Guest

  4. #3

    Default Re: refreshing data

    Hello,

    I'm trying to overcome the same issue, only I need to do it with a xml model. Is that even possible?

    Thanks
    maxkool Guest

  5. #4

    Default Re: refreshing data

    Are you certain that the XML file hasn't been cached? I bet it has. To see
    this for sure, see what the HTTP status code is on the response from your
    web server. I bet it's indicating that it has been cached.


    Carson
    ____________________________________________

    Carson Hager
    Cynergy Systems, Inc.
    [url]http://www.cynergysystems.com[/url]
    Adobe Flex Alliance Solutions Partner

    Email: [email]carson.hager@cynergysystems.com[/email]
    Office: 866-CYNERGY
    Mobile: 1.703.489.6466


    "maxkool" <webforumsuser@macromedia.com> wrote in message
    news:dsqjfk$lqs$1@forums.macromedia.com...
    > Hello,
    >
    > I'm trying to overcome the same issue, only I need to do it with a xml
    > model. Is that even possible?
    >
    > Thanks

    Carson Hager Guest

  6. #5

    Default Re: refreshing data

    Did you figure this out?

    You will not be able to use source=, because that is a compile time
    assignment. Instead, you need to use HTTPService.

    You will call the service's send() method from your getData() function.
    Either bind the model to the HTTPService result, or, as is my preference, use a
    result handler and assign the result to whatever you want. This is easier to
    debug than binding.

    Getting data in Flex is, sadly, never very simple.

    Tracy

    ntsiii Guest

  7. #6

    Default Re: refreshing data

    Hello,

    Sorry it's talen me so long to get back to you. Yes, I did figure out the
    whole refresh thing:

    Here is a short example I didnt want to take up too much space on the forum:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
    marginTop="0"
    marginBottom="0"
    marginLeft="0"
    marginRight="0"
    height="100%" width="100%" xmlns:local="*"
    initialize="myHTTPData.send();trace('calling service');"
    backgroundColor="#cccccc"
    creationComplete="startApp()">
    <mx:HTTPService url="link to xml data source" id="myHTTPData" method="GET"
    result="refreshdata">
    </mx:HTTPService>
    <mx:Script>
    <!]>

    </mx:Script>

    i hope this helps other guys in the same boat i was in

    jorge

    maxkool Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139