Pls help me. I am working on the example given in the book.
The response is not getting updated on the html page.
here is my html page.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet" type="text/css">
<TITLE>ht.html</TITLE>
<script src="prototype.js" type="text/javascript"></script>
<script src="rico.js" type="text/javascript"></script>
<script language="javascript">
function Init1()
{
ajaxEngine.registerRequest('getPersonInfo', 'getPersonInfo.jsp');
ajaxEngine.registerAjaxElement('personInfo');
}
function getPersonInfo(selectBox)
{
var nameToLookup = selectBox.value;
ajaxEngine.sendRequest( 'getPersonInfo',
"firstName=" + nameToLookup);
}
Init1();
</script>
</HEAD>
<BODY>
<div id="rolodexTabContent" class="accordionTabContentBox">
<table cellspacing="5" cellpadding="5"><tr>
<td valign="top">
<select id="listBox" onchange="getPersonInfo(this)">
<option value="SABAH">Sabah u din
<option value="HASAN">Hasan Tanvir
<option value="MUZIO">Muzaffar Iqbal
<option value="YASIR">Yasir Siddiq
<option value="WAQAS">Waqas u Din
</select>
</td>
<td>
<div style="display:inline" id="personInfo">
Select a name to the left to see the AJAX rolodex entry
for the selected person.
</div>
</td>
</tr></table>
</div>
</BODY>
</HTML>
and here is the jsp page through which i m trying to send response.
<BODY>
<%
String resp = new String("");
resp+= "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>" +
"<ajax-response>" + "<response type=\"element\" id=\"personInfo\"> " +
"<div class=\"person\"><span class=\"personName\">Mr. Pat " +
"Barnes</span><span class=\"personAddress\">1743 1st Avenue " +
" </span></div> </response> </ajax-response>";
System.out.println(resp);
response.getWriter().write(resp);
out.println(resp);
%>
</BODY>
Ur help will ne highly appreciated.
Viral Gupta
on 02.02.2007 21:35
on 23.02.2007 03:06
Hi try removing the <BODY></BODY> tags from around your response page code


