Hi folks, i have the grid code as below in jsp and action class call is also successful. during rener_table, i do see that xml is also created but when the jsp is displayed, grid does not get data populated. Action controller is on struts2. Please help.
my GridConnectorServlet looks like as below. Table name is grid50000 and columns are defined below.
public class GridConnectorServlet extends ConnectorServlet {
@Override
public void configure() {
Connection conn= ( new DataBaseConnection()).getConnection();
GridConnector gc = new GridConnector(conn,DBType.MySQL );
//gc.event.attach(new GridConnectionBehaviour(conn));
String table = "grid50000";
gc.dynamic_loading(100);
gc.enable_log("c:/temp/grid.log", true);
gc.render_table(table,"item_id","item_id,item_nm,item_cd");
}
public GridConnectorServlet() {
super();
}
@Override
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
super.doGet(req, res);
}
@Override
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
super.doPost(req, res);
}
Also, i have tired direct action url for the action defined and xml is produced as below.
<?xml version="1.0" encoding="utf-8" ?>Please help why does not the grid gets data populated.
XML looks valid.
Please be sure that GridConnectorServlet is correctly mapped to the GridConnectorAction url.
You can enable loggin on connector to be sure is it triggered or not
Thanks for replying. Please help.
I had the logs enable as mention by you and also the GridConnectorServlet invoked during debugging. I see the flow executes fine and also traced the response through TCP/IP monitor and xml seems to be fine.
Getting GridConnectorAction mapped correctly to GridConnectorServlet and thinking there could be an issue with Servlet and configure, changed the method to be as below. But still no luck.
Grid still does not seems to be having data.
public class GridConnectorServlet extends ThreadSafeConnectorServlet {
private static final long serialVersionUID = 5106978945059203598L;
public void configure(HttpServletRequest req, HttpServletResponse res) {
Connection conn= ( new DataBaseConnection()).getConnection();
GridConnector gc = new GridConnector(conn,DBType.MySQL );
String table = "grid50000";
gc.dynamic_loading(100);
gc.enable_log("c:/temp/grid.log", true);
gc.servlet(req, res);
gc.render_table(table,"item_id","item_id,item_nm,item_cd");
}
}
Its quite unusual.
If grid calls data loading url there are 3 possible results
a) valid xml received - data will be shown in the grid
b) invalid xml received - “xml error” message will be show
c) any server side which results in error message output will produce invalid xml and the same “xml error” result.
So if you see that request correctly triggers data and it is loaded in the grid - there is no way to not produce some visual response ( render data in the grid, or show the error message )
P.S. I have doublechecked client side code which was posted above, and for grid’s init, in case of dhtmlx 3.5 you need only two files
[code]
[/code]dataprocessor is included in the dhtmlx.js
Sure thanks let me try…noticed that there were some errors while rendering jsp page related to images file not found…fixed that but still grid is empty without any server or client side error…
Thinking to refractor sample code with latest versions to try…please send me the link for latest js and connector jars or any other thing it might need…
Thanks…appreciate your response…
Having trouble with this myself, the problem is here:
gc.render_table(table,“item_id”,“item_id,item_nm,item_cd”);
Remove “item_id” from the list of columns so that it looks like this:
gc.render_table(table,“item_id”,“item_nm,item_cd”);
Placing the key field in the list of columns produces an “ambigious column” error when dynamic loading is in use (gc.dynamic_loading(100);).