This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Solutions to refresh dynamic content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Solutions to refresh dynamic content" Watch "Solutions to refresh dynamic content" New topic
Author

Solutions to refresh dynamic content

Amir khan
Ranch Hand

Joined: Aug 15, 2005
Posts: 47
Hi All,

In my current role,I am using Flash and Xml, the problem i face is if i change anything in the flash(content), I have to open up a new window for the changes to be reflected, just wanted to know if Ajax might help me out to reflect the changes like it does for any other application after a fixed time interval( ie asynchronously)
[Editted to provide meaningful topic]
[ July 13, 2006: Message edited by: David O'Meara ]
Sas Jacobs
Author
Ranch Hand

Joined: Jun 24, 2006
Posts: 46
Hello Amir

To clarify, are you talking about the fact that Flash doesn't reflect updated external XML content?

You can set up your Flash file to poll the server at regular intervals and reload the content in just the same way that you'd do it using Ajax. Effectively, you're calling a function at regular intervals. JavaScript and Flash ActionScript have much the same functionality in this regard.

Alternatively, you can use a socket server with XMLSockets in Flash to maintain a continuous connection to the XML content and reflect updated content immediately.

Cheers and I hope that helps

Sas
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Amir,

Look into FLEX. You do not have to use their builder to use FLEX. Google uses it in their finicial page with the stock window you can drag and drop date ranges and such.

Eric
Amir khan
Ranch Hand

Joined: Aug 15, 2005
Posts: 47
Sas,
Sorry for not putting across the details earlier, the problem is,its not a live layer and i do not want the flash to be continiously updated on the live site, it will use the bandwidth for no reason.I am using flash &xml during development layer, and during content uploading and changes doesnt reflect even if i refresh the page, i have to necessarily reload my page or flush out my cookies n all.

Eric,

I had recommended to them,as it was earlier suggested by you but it was rejected and since they are gonna incorporate Ajax later, i was wondering if ajax can help me with my issues



Also want to inform that we are using our own customized tool, to maintain the consistentcy.

I am still not very clear that Ajax can help me or not


Thanks for your valuable suggestion
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Code use Iframes to refresh the content.

Eric
Sas Jacobs
Author
Ranch Hand

Joined: Jun 24, 2006
Posts: 46
Amir

Ajax and Flash are both request and response type approaches. This means that they have to poll the server for changes or use some other event to check for changes. Ajax doesn't offer you any advantages over Flash in this regard.

You can force Flash to refresh the interface by appending a changing querystring to the swf URL in the OBJECT and EMBED tags. I often use a timestamp generated with JavaScript.

Cheers

Sas Jacobs
 
jQuery in Action, 2nd edition
 
subject: Solutions to refresh dynamic content