problem with grid

hi i have the following code.my problem is here grid is populating but not able to modify the data
.it is throwing an error saying message from webpage error .what is wrong?
thanking you.

Structure.jsp

<%@page import=“java.sql.*”%>
<%@ include file=“connect.jsp” %>

<% st=conn.createStatement(); rs = st.executeQuery("SELECT * FROM grid50000"); md = rs.getMetaData(); int count = md.getColumnCount();

int i=0;
for(i=1;i<=count;i++)
{
%>

<%

}
%>

student id course
> <%=md.getColumnName(i) %> <%=md.getColumnTypeName(i) %>


Render1.java

import java.io.IOException;
import java.lang.String;
import java.io.PrintWriter;
import java.sql.Connection;
import java.text.Normalizer.Form;

import com.dhtmlx.connector.;
import javax.servlet.ServletException;
import javax.servlet.http.
;
public class Render1 extends ConnectorServlet
{
String st=new String();
String st1=new String();
String st2=new String();
String st3=new String();
String st4=new String();
String st5=new String();
String n=new String();
String n2=new String();

@Override
protected void configure()
{
Connection conn= ( new DataConnection()).getConnection();

GridConnector c = new GridConnector(conn);

c.dynamic_loading(100000);
//c.event.attach(new Grid_02_RenderingBehavior());
c.render_table(“grid50000”, “item_id”,st);

}
public void doPost(HttpServletRequest request,HttpServletResponse response)throws IOException, ServletException
{
response.setContentType(“text/html”);
PrintWriter out = response.getWriter();

String[] check;

check= request.getParameterValues(“check”);
System.out.println(“length of check is”+check.length);
if(check!=null)
{
for(int j=0;j<check.length;j++)
{
if(j==0)
{
st1=new String(“100”);
st2=new String(“ed”);
st=new String(check[j]);
st3=new String(“center”);
st4=new String(“#connector_text_filter”);
st5=new String(“connector”);
}
else
{
st1=st1.concat(“,”);
st1=st1.concat(“100”);
st2=st2.concat(“,”);
st2=st2.concat(“ed”);
st =st.concat(“,”);

st =st.concat(check[j]);

st3=st3.concat(“,”);
st3=st3.concat(“center”);
st4=st4.concat(“,”);
st4=st4.concat(“#connector_text_filter”);
st5=st5.concat(“,”);
st5=st5.concat(“connector”);
}
}

n=new String(“,false,[”);

for(int j=0;j<check.length;j++)
{

n=n.concat(" " “);
n=n.concat(“background-color:B0E2FF”);
n=n.concat(”" “);
if(j==check.length-1)
{ n=n.concat(”]“);
break;
}
n=n.concat(”," );
}

n2=new String(“,[”);

for(int j=0;j<check.length;j++)
{
n2=n2.concat(“"”);
n2=n2.concat(“background-color:B0E2FF”);
n2=n2.concat(“" “);
if(j==check.length-1)
{ n2=n2.concat(”]”);
break;
}
n2=n2.concat(“,” );
}

System.out.println("column width values are
"+st1);

System.out.println("column type values are
"+st2);
System.out.println("selected columns are
" +st);
System.out.println("column align values are "+st3); System.out.println("column filter values are “+st4);
System.out.println(” new is “+n);
System.out.println(” new2 is "+n2);

}

request.setAttribute(“data”,st);
request.setAttribute(“data1”,st1);
request.setAttribute(“data2”,st2);
request.setAttribute(“data3”,st3);
request.setAttribute(“data4”,st4);
request.setAttribute(“data5”,st5);
request.setAttribute(“n”, n);
request.setAttribute(“n2”, n2);
//response.sendRedirect(response.encodeURL(“receive2.jsp”));

getServletContext().getRequestDispatcher(“/receive2.jsp”).forward(request,response);

}

}

Receive2.jsp



You are using
var dp = new dataProcessor(“Render1”);
as result grid sends updated info to the url, but currently ( as far as I can see ) script at that url generates data stream, and do not process saving.

thanks for your reply.so ,does it mean that can’t we achieve modifications on grid by passing parameters dynamically?.If there is any other solution please let me know.the following log information has generated when attached a file.it says that it is not generating any crud operation queries.and i tried it by adding debug.js file.in debug.js console it is saying some row marked or valid or deleted etc…but the impact is not permanent.

====================================
Log started, Thu May 10 12:30:47 IST 2012

DB query
SELECT item_id,item_nm,item_cd,x,roja FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 1734ms

====================================
Log started, Thu May 10 12:35:57 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x,roja FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 1546ms

====================================
Log started, Thu May 10 12:36:09 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x,roja FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 1374ms

====================================
Log started, Thu May 10 14:48:09 IST 2012

DB query
SELECT item_id,item_nm,item_cd,x,roja FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 1750ms

====================================
Log started, Thu May 10 14:49:26 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x,roja FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 1312ms

====================================
Log started, Thu May 10 14:50:15 IST 2012

DB query
SELECT item_id,item_nm,item_cd,x,roja FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 750ms

====================================
Log started, Thu May 10 14:51:10 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x,roja FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 1140ms

====================================
Log started, Thu May 10 14:52:53 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x,roja FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%7%’ AND item_nm LIKE ‘%%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%7%’ AND item_nm LIKE ‘%%’

Done in : 93ms

====================================
Log started, Thu May 10 14:52:58 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x,roja FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’

Done in : 15ms

====================================
Log started, Thu May 10 14:54:41 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x,roja FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 1234ms

====================================
Log started, Thu May 10 14:54:55 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x,roja FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%g%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%g%’

Done in : 31ms

====================================
Log started, Thu May 10 14:55:06 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x,roja FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’

Done in : 16ms

====================================
Log started, Thu May 10 14:55:13 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x,roja FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 1328ms

====================================
Log started, Thu May 10 14:55:30 IST 2012

DB query
SELECT item_id,item_nm,item_cd,x,roja FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 922ms

====================================
Log started, Thu May 10 14:55:39 IST 2012

DB query
SELECT item_id,item_nm,item_cd,x,roja FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_nm LIKE ‘%%’ AND item_cd LIKE ‘%g%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_nm LIKE ‘%%’ AND item_cd LIKE ‘%g%’

Done in : 15ms

====================================
Log started, Thu May 10 14:55:46 IST 2012

DB query
SELECT item_id,item_nm,item_cd,x,roja FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_nm LIKE ‘%%’ AND item_cd LIKE ‘%%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE roja LIKE ‘%%’ AND x LIKE ‘%%’ AND item_nm LIKE ‘%%’ AND item_cd LIKE ‘%%’

Done in : 16ms

====================================
Log started, Thu May 10 14:55:57 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 843ms

====================================
Log started, Thu May 10 14:56:05 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x FROM grid50000 WHERE x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%g%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%g%’

Done in : 16ms

====================================
Log started, Thu May 10 14:56:07 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x FROM grid50000 WHERE x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’

Done in : 16ms

====================================
Log started, Thu May 10 14:56:11 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x FROM grid50000 LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000

Done in : 828ms

====================================
Log started, Thu May 10 14:56:17 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x FROM grid50000 WHERE x LIKE ‘%p%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE x LIKE ‘%p%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’

Done in : 15ms

====================================
Log started, Thu May 10 14:56:20 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x FROM grid50000 WHERE x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’

Done in : 16ms

====================================
Log started, Thu May 10 14:56:22 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x FROM grid50000 WHERE x LIKE ‘%t%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE x LIKE ‘%t%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’

Done in : 15ms

====================================
Log started, Thu May 10 14:56:25 IST 2012

DB query
SELECT item_id,item_id,item_nm,item_cd,x FROM grid50000 WHERE x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’ LIMIT 0,100000

DB query
SELECT COUNT(*) as DHX_COUNT FROM grid50000 WHERE x LIKE ‘%%’ AND item_cd LIKE ‘%%’ AND item_id LIKE ‘%%’ AND item_nm LIKE ‘%%’

Done in : 16ms

Normally you can use connector for data saving, but in your code you are defining some custom logic for post handler

public void doPost(HttpServletRequest request,HttpServletResponse response)throws IOException, ServletException { response.setContentType("text/html"); PrintWriter out = response.getWriter();

While normally post handler used by connector itself for data saving.
Just remove this custom doPost and connector data saving logic will be restored

thank you.but with out post() method how can i receive values from jsp and how to create request and response objects in servlet.Please tell me i tried but i didnt understand how to achieve this.
Thanking you…

Hi…
I removed dopost() method and i used ThreadSafeConnector class.so in the configure() method we can have req and res.but from this servlet iam unable to pass the values to jsp.it is not calling jsp.i tried both response.send and request dispatcher.What could be the reason.is this the way you had suggested? how can i solve this.
Thanking you…

Connector servlet fully handles response, it need to output specific xml response so any other output will be ignored.

If you need to have custom post action which is not related to connector, why do not create a separate servlet, which will not use connector at all?