Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Refreshing part of a page

Posted on 2004-08-23
4
Medium Priority
?
178 Views
Last Modified: 2010-04-01
I have a requirement for which i have to go to the server , fetch some data and refresh only a part of the page. The rest of the page should remain as it is. I am thinking of using Frames. Any other way to do it ??

Thanks,
Mrigank.
0
Comment
Question by:mrigank
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 11868402
> Any other way to do it ??

Not that I can think of...  Why can't you refresh the whole page?
0
 
LVL 5

Author Comment

by:mrigank
ID: 11868617
Actually if i refresh the whole page, i will have to save the state of the page... which i would not want to do .. as i do not want to make db calls....  Not sure if struts will do the same for me
0
 
LVL 35

Accepted Solution

by:
TimYates earned 120 total points
ID: 11868629
You will need to use frames then...  Or you might be able to use javascript (if all you want to do is change the options in a list or something depending on a selection...

Tim
0
 
LVL 2

Expert Comment

by:Twitchlet
ID: 11869603
You could use an iFrame for this, but be warned that it's going to knock your cross-browser compatability right out of the water.

What you do is place an iFrame somewhere on your page and give it the attribute [style="display:none"]. When you post to the server, set the name of the iFrame as your target. What you do then is have the server return a page of javascript to the browser inside the hidden iFrame. The script will then execute.

You can use DOM targetting in javascript to alter on-creen values provided that these values are within valid, named forms and each item that may be altered has a name.

For example, you could say have a hidden control variable change to the value 17, and have an onscreen select box change it's contents with the returned script below:

<script language="JavaScript">
  parent.theForm.controlVar.value = 17; //change value of hidden field
  parent.theForm.areaSelect.options.length = 0; //clear the previously held array of options

  //array of option names
  var options = new Array('option A', 'option B', 'option C');

  //array of option values
  var values = new Array('A','B','C');

  //grab a short handle on the select box
  var sBox = parent.theForm.areaSelect;
  for (i = 0; i < options.length; I++) {
    sBox.options[i] = new Option(options[i], values[i]);
  }
</script>

If you need more information about dynamic select boxes you can visit http://www.quirksmode.org/js/options.html.

Hope this helps.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question