Your concept seems ok. Is there any part you are having difficulty with?
I dont have a major problem with that. i was just wodering if that was an efficient way. From first glance, it seems using setinterval to continously read from a database in a multiuser environment might be too much. I can play with that. Do you know of another way?
The other thing is I don't like the way the data reloads. When I use an ajax call and put the return into an html span using setinterval to keep reloading the data.
All the data refreshes itself, going black and then coming back. It doesnt stack or update smoothly, which is why I'm wondering if it's really the right way.
I'm a bit of a newb to this area, but the answer likely lies in how you are returning the data to the screen. If you bind the data to a container and refresh the whole container, you'll get the behavior you described. Instead need to look into creating a new container for each new item. This would mean manipulating the DOM to create the new node and then bringing it in gracefully.
I wish I could give you an example in code, but I don't have one. I have been learning jQuery lately though and it seems very suited to making this rather easy.
Just a thought...
No I kind of see what you're saying actually. I'll have to play with it and see how to create a new <span> for each return.
Be careful that you do not wind up spending an unjustifiable amount of time trying to "make it work."
While I definitely agree with the advice to be careful of being time conscious, I might respectfully suggest that CF and many manner of JS can coexist very peacefully and yield some real efficiency benefits.
While Coldfusion offers some great tools, there are some things that it doesn't offer much of, like effects (scriptaculous and jQuery are stronger here) . I've also noticed that sometimes the CF solutions can become cumbersome without some custom JS work to streamline it. We had a page once with a large table of data where each cell was initially set up using a CF Ajax tool. When the data set go large though, we found that CF's autogenerated JS code was growing to large for a reasonable page load time - it was creating a duplicate function for every cell. The solution was to use our own code to handle the cells and reuse a single instance of the CF functionality.
This may not have been outside what you suggested not "stepping out", but in any case, we have had really good results combining CF's built-in JS tools with other libraries like jQuery (currently my favorite) and Scriptaculous. CF offers a lot and we certainly make use of it (I love the 'tabbed' layouts, cfdiv,cfform,etc. ), but there are lots of tools.
We use them all with the obvious caveat that you do need to be judicious in selecting tools. You do need to be careful to use (load) only what you need.