Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is it possible to refresh part of a page, without a full page reload?

Engaged ,
Aug 26, 2009 Aug 26, 2009

What I'd like is a solution that a part of my web page to update without having to do a full page refresh.  Here's my real case scenario:

I created a board at my agency that lists a table-grid of all the employees and their current status during the work day.  The table indicates when an employee is away from their office: at lunch, on sick leave, vacation, etc.  This table-grid is very helpful to our receptionists who need this information throughout the day when they get calls from clients asking for a specific employee -- the receptionist can easily look at the board and determine if that employee is currently available.

The board uses a <CFQUERY> to populate itself with data stored in a database.  However, with 100+ employees in my office, people are constantly coming and going from the building.  To keep this data somewhat "fresh" for the receptionists (stale data would be bad of course), I have a manual page refresh every 20 seconds.  Each 20 seconds reloads the page and the <CFQUERY> is run each time to update the data in the board.

<meta http-equiv="refresh" content="20" /> is the call to refresh on my page.

While this gets the job done, it feels very clunky and poorly implemented.  If you have sound on, you can hear that page reload "click" noise, which is also an annoyance.  Is there a better way to have just the table-grid update without the entire page having to update?

I am open to suggestions about AJAX with CF as well, as I've heard AJAX could maybe do it?  The problem is too complex to get any good search results on google though, so I'm here to see if anyone else knows how to deal with this.  thanks!!!

Note: I am using ColdFusion 7.  I saw that CFDIV could possibly handle this in CF8, but that's not in my budget!

2.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 26, 2009 Aug 26, 2009

Put your grid into an iframe and meta refresh it at the desired interval.

Translate
Valorous Hero ,
Aug 26, 2009 Aug 26, 2009

AJAX is the likely solution.  If CF8 is out of reach for you, there are older, community grown AJAX frame works, CFAJAX and CFCAJAX are two of the biggest.   But there is nothing preventing one from rolling one's own AJAX as all it is JavaScript making HTTP requests behind the scenes with the xmlhttprequest object combined with manipulation of the DOM (Document Object Model) to update the user interface.

This is a big topic and there are many tutorials and blogs out there that are great to get started with.  Helpfully I have given you a few key words that will help you narrow down your search results.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 26, 2009 Aug 26, 2009

Put your grid into an iframe and meta refresh it at the desired interval.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 27, 2009 Aug 27, 2009
LATEST

Going try this now, I'll be back with my result!  thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources