473,287 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

refresh jsp with ajax

8
Hi all,

I have a jsp page and i use the <display:table> in it.
I want to refresh the table but not all page.
I use AJAX for this operation.But I can't refrest the table.How can I post the table data to jsp during refresh...

Please help...
Thanks...
Nov 20 '07 #1
5 8241
acoder
16,027 Expert Mod 8TB
Can you post your AJAX code?
Nov 21 '07 #2
oyis
8
this is my jsp code;
[HTML]

var page = "doktor.do?dispatch=dene";
function ajax(url,target)
{
// native XMLHttpRequest object
document.getElementById(target).innerHTML='<div align="center"><br /><br /><img src="loading.gif"><br />Yükleniyor..</div>';
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = function() {ajaxDone(target);};
req.open("GET", url, true);
req.send(null);
// IE/Windows ActiveX version
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = function() {ajaxDone(target);};
req.open("GET", url, true);
req.send();
}
}
setTimeout("ajax(page,'randevu')", 10000);
}function ajaxDone(target) {
// only if req is "loaded"
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200 || req.status == 304) {
results = req.responseText;
document.getElementById(target).innerHTML = results;
} else {
document.getElementById(target).innerHTML="ajax error:\n" +
req.statusText;
}
}
}


</script>
</HEAD>
<body background="<%=request.getContextPath()%>/images/bck.gif"
bgcolor="#FFFFFF" text="#000000" link="#800000" vlink="#FF0000"
alink="#800000" leftmargin="0" topmargin="0" marginwidth="0" onLoad="ajax(page,'randevu');">

..........................


<div id="randevu">
<table width="100%">
<tr>
<TD>
<display:table width="100%" id="row" cellpadding="2px" pagesize="15" border="1" styleClass="TABLE.asd" name="randevuDTO2" requestURI="doktor.do?dispatch=giris">
<display:column width="50%" title="Hasta" property="hastaAd" href="doktor.do?dispatch=buldum" paramId="randevuID" paramProperty="randevuID"></display:column>
<display:column title="Saat" property="saat"/>
<display:column title="Durum" property="durum" />

<display:setProperty value="" name="basic.msg.empty_list"/>
<display:setProperty value="Bir kayıt bulunmuştur." name = "paging.banner.one_item_found"/>
<display:setProperty name="sort.amount" value="list" /> <!-- tüm listeyi kendi içinde sıraladıktan sonra paginge sokar -->
<display:setProperty name="paging.banner.group_size" value="3" /><!-- altta link olarak gösterilecek sayfa sayısı -->
<display:setProperty name="paging.banner.some_items_found" value="<FONT color='navy'><br>{0} Kayıt Bulundu...{2}-{3} Arası Kayıtlar<br> </FONT>" /><!-- Sayfalama mesajı -->
<display:setProperty name="paging.banner.full" value="<FONT color='navy'><a href={1}>&lt&lt</a> <a href={2}>&lt</a> {0} <a href={3}>&gt</a> <a href={4}>&gt&gt</a></FONT>" /><!--sayfalama linkleri;ilk yada sonda deÄ?ilken -->
<display:setProperty name="paging.banner.first" value="<FONT color='navy'>&lt&lt &lt {0} <a href={3}>&gt</a> <a href={4}>&gt&gt</a></FONT>" /><!--sayfalama linkleri;ilk kayıtttayken-->
<display:setProperty name="paging.banner.last" value="<FONT color='navy'><a href={1}>&lt&lt</a> <a href={2}>&lt</a> {0} &gt &gt&gt" /><!--sayfalama linkleri;son kayıttayken-->
<display:setProperty name="paging.banner.all_items_found" value="<FONT color='navy'><br>{0} Kayıt Bulundu...Sayfa </FONT>"></display:setProperty>
<display:setProperty name="paging.banner.placement" value="bottom" />
<display:setProperty name="paging.banner.some_items_found" value="{0} tane kayit ..."/>
</display:table>

</TD>
</TR>
</table>
</div>
[/HTML]

-------------------------------------
I can't post the table elements back from action:(
Nov 21 '07 #3
acoder
16,027 Expert Mod 8TB
If you want to send the table data, you will need to add the data as parameters with the URL, e.g. "url?param1="+tabledata1+"&param2="+tabledata2 ...
Nov 21 '07 #4
oyis
8
ok I will do that.
how can I send the table back at java code?
Nov 21 '07 #5
acoder
16,027 Expert Mod 8TB
ok I will do that.
how can I send the table back at java code?
You do that with your server-side code.

You can either return HTML and just replace everything or XML/JSON and parse the response.
Nov 21 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: rockdale | last post by:
Hi, all I am coding a asp.net application as user data entry and report interface. We also have another C#.net appplication (a server) does some other stuff, my webserver can send and receive...
2
by: Lonifasiko | last post by:
My ASP.NET application's main page should change values on screen when some extern event occurs (a change in the state of a machine monitored by a .NET Remoting object). That is, this .NET Remoting...
0
by: Phillip Ian | last post by:
Tried this over in CSharp.General and didn't get anything, so I thought I'd try again here. If there's an AJAX specific group I could ask this in, please let me know...I did look. I'm trying to...
10
by: Piotr Nowak | last post by:
Hi, Say i have a server process which listens for some changes in database. When a change occurs i want to refresh my page in browser by notyfinig it. I do not want to refresh my page i.e....
5
by: Kaante | last post by:
Hi, I basically have two frames on my page, the top one contains users stats and the bottom frame contains the website. I want to have a message icon on the top frame which would flash once the...
2
by: oaksong | last post by:
I have an embedded user control based on TreeView that I would like to refresh dynamically. The control is in a <div that's hidden until a specific selection has been made. Unfortunately the...
1
by: christian | last post by:
Hello I use a AJAX refresh script on a page to test a $var state <div> <? include ("include/refr.inc.php"); //ajax script for reload require ("bd_inc.php"); //test the line state buzy or...
6
by: Peter | last post by:
I have a APS.NET 3.5 webpage which calls a web service. What I need is to update this page automatically when a value changes in the webservice, does anyone have an example? Thank You ...
4
by: eihabisaac | last post by:
hi all i want to refresh a div using ajax, i wrote this code: index.php <script src="ajax/moniter/moniter.js" type="text/javascript"></script> <body onload="moniter();"> <div id="moniter">
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.