File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

screen refresh

 
S Chander
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for the help Yuriy. I was able to test out a sample screen with your suggestions.
Chander
 
Charlie Sturman
Ranch Hand
Posts: 112
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic