Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

screen refresh

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Please redirect me to the appropriate thread if this has been discussed earlier.
I want to refresh HTML screens with updated information without reloading the screen again. The actual aim to refresh the screens without have constant flickering of the screens.I had been trying to have two frames. In one frame I tried to call a servlet to send the updated information. This servlet gets called every 5 seconds or so to check for periodic updates.
Now I want to display the fresh data in the second frame without repainting it. Is there any way to do it? Can I use a javascript function to populate the fresh data in the second frame?
If someone can send some code snippets explaining this it will be of immense help to me.
thanks in advance
chander
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did a demo some time ago with this technic.
if you have main page
<frameset cols="100%,*
<frame src=src1 name=content
<frame src=myservlet
</frameset
and your content frame has a
<form name=form1
<input name=in1
to update it your servlet should generate the following javascript:
top.document.form1.in1.value="new value"
I use this example, since input text is a simpliest thing that you could have. If you need a static text to be changed, you should wrap it into "span" with sertain id, so if
<span id=sp1
than to change the text:
top.document.getElementById("sp1").innerHTML="new value"
Note, that you will have a problem with doing span staff in NS4
it get more complicated, if need to change select's or add/remove some elements - I mean not just edit existing information.
 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Forgot to mention - it may be better to use <IFRAME in one page, instead of a <FRAMESET with frames.
So you will have only one page with hidden IFRAME that will reload your servlet, wich will generate JavaScript to update page content.
 
S Chander
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for the help Yuriy. I was able to test out a sample screen with your suggestions.
Chander
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www-106.ibm.com/developerworks/web/library/wa-exrel/index.html?dwzone=web
hth
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic