dynamic populating DHMLXGRID

Hi,

I am unable to come out of it. I am Explaining the scenario and please help me out in this.

I have a html file in which I added the DHTMLX grid , my html file is:



AreaCode:







Available Plots-------------------------------



Plot No





 Customer Info





























On clicking the button �SEARCHAREACODE� a popup opens and I select an �areacode� then selected areacodes plotno get populated in the textbox as soon as the plot no gets populated I want the gridbox1 which contains customer details of the selected areacode to be populated in the grid for this I have written a servlet

And the servlet code is:

package PlotManagement;

import java.io.;

import java.sql.ResultSet;

import java.sql.Statement;

import javax.servlet.
;

import javax.servlet.http.;



import PlotManagement.DBConnection;



public class GetCustomerDetails extends HttpServlet {



public void doGet(HttpServletRequest request,

HttpServletResponse response)throws IOException, ServletException

{

//response.setContentType(“application/xml”);

PrintWriter out = response.getWriter();

ResultSet rs;

int i=1;

// out.println("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");

// out.println("");

try

{

String areacode=request.getParameter(“areacode”);

String plotno=request.getParameter(“plotno”);

//String plotno = nplotno.replace( " “,”+" );



DBConnection d= new DBConnection();

d.connect();



out.println("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");



Statement stmt = d.connection.createStatement();



rs = stmt.executeQuery(“SELECT COUNT(b.PropertyId) Prop_Cnt, a.CustomerId,CASE a.OwnerCategory WHEN 1 THEN ‘VVIP’ WHEN 2 THEN ‘VIP’ WHEN 3 THEN ‘Regular’ ELSE ‘Missing’ END,a.FirstName + ’ ’ + a.FatherName + ’ ’ + a.FamilyName CustomerName,a.ArabicName,a.Nationality, a.POBox, a.Emirate, a.OfficeNo,a.ResidenceNo ,a.MobileNo,a.FaxNo,a.Comments, b.OwnerId FROM Property b, Customer a Where b.Customerid = a.Customerid AND b.AreaCode = '”+areacode+"’ AND b.PlotNo = ‘"+plotno+"’ AND ISNULL(b.DeleteRecord,0) = 0 AND ISNULL(b.InSewerNetworkRange,0) = 1 GROUP BY a.CustomerId, a.OwnerCategory, a.FirstName, a.FatherName, a.FamilyName,a.ArabicName, a.Nationality, a.POBox, a.Emirate, a.OfficeNo,a.ResidenceNo , a.MobileNo, a.FaxNo, a.Comments, b.OwnerId ORDER BY a.CustomerId");

while ( rs.next())

{

int pcount=rs.getInt(1);

String customerid=rs.getString(2);

String ownercategory=rs.getString(3);

String name=rs.getString(4);

String nameString = name.replace( ‘&’, '
’ );

String arabicname=rs.getString(5);

String arabicnameString = arabicname.replace( ‘&’, ‘*’ );

String nationality=rs.getString(6);

int pobox=rs.getInt(7);

String emirate=rs.getString(8);

String officeno=rs.getString(9);

String residenceno=rs.getString(10);

String mobileno=rs.getString(11);

String faxno=rs.getString(12);

String comments=rs.getString(13);

String ownerid=rs.getString(14);







out.print("\n"+i+"\n"+pcount+"\n"+customerid+"\n"+ownercategory+"\n"+nameString+"\n"+arabicnameString+"\n"+nationality+"\n"+pobox+"\n"+emirate+"\n"+officeno+"\n"+residenceno+"\n"+mobileno+"\n"+faxno+"\n"+comments+"\n"+ownerid+"\n\n");

i++;



}

out.print("");;



d.connection.close();

}



catch(Exception e)

{ e.printStackTrace();

}



}

public void doPost(HttpServletRequest request, HttpServletResponse response)

throws IOException, ServletException {



doGet(request, response);

}







}









But if I call the servlet in the grid onload the initial areacode and plotno fields have null value and the grid is blank but once the user select the areacode how can I trigger the grid to populate itself. Please help me out.

Reply me soon please.













Ruquia

but once the user select the areacode how can I trigger the grid to populate itself
Something similar to next


function reload_grid(areacode,plotno){
grid.clearAll(); //delete old data
grid.loadXML(gridQString+"?areacode="+areacode+"&plotno="+plotno)
}