ConnectorServlet in jsp

Hi,
How to write ConnectorServlet in jsp?

Thanks and Regards,
Karthick K.

You need to create a new class , using ConnectorServlet as base class, and map this class directly to the URI through web.xml, there is no need for separate jsp pages.

Hi,
I am getting error Error type : LoadXML description : Incorrect XML.
It works in my computer and when the same code is deployed in my friends computer but it is not working . I have used dhtmlxcommon_debug.js to track the error it says bad class version and i am using java 1.5. Any idea about this? Expecting your reply soon.

Thanks,
Karthick K.

While latest version of connector must work with java 5 without any problems, the jar file itself was compiled with java 6, so you may need to recompile java classes in the jar with your version of java ( jar contains full set of sources )

hi,
I have used dhtmlxcommon_debug.js to track the error. It shows like this

           [b]Loading:lead.do?uid=127287565831&timeshift=-330
           status:200
           Error:
           XML: False
           Response:[/b]

What might went wrong? do you have any idea?

Thanks,
Karthick K.

If nothing shows in “response” - it means servlet doesn’t output anything at all, it may be a wrong servlet or some server side error which appears before any output is started

You can try to enable logging
docs.dhtmlx.com/doku.php?id=dhtm … nd_logging

Hi,
many thanks .

Regards,
Karthick K.

Hi,
How to display start time and end time in 12 hour format in dhtmlxscheduler?

Thanks,
Karthick K.

There are a lot of date formatting settings
docs.dhtmlx.com/doku.php?id=dhtm … ngs_config

samples/01_initialization_loading/02_hour_scale_format.html
scheduler.config.hour_date="%h:%i %A";

hi,
That works. I have one more question. Is it possible to hide end date not the whole part but except end time in scheduler?

Thanks,
Karthick K.

Can be done only through code customization.

hi,
code customization? how? can you please explain me in detail? I have one more question.
Is it possible to show two different kind of scheduler based on a condition in a single jsp page? I tried to load scheduler using ajax but its not working. Do you have any idea? Expecting your reply soon.

Thanks,
Karthick K.

It possible to change the render method of “time” form block, so it will not render unnecessary controls. Or update its get_value method to set end_date according to your custom rules.

Is it possible to show two different kind of scheduler based on a condition in a single jsp page
Nope, only one scheduler per page is possible
But you can use iframes

Hi,
Thanks for your assistance.

Regards,
Karthick K.

Hi,
Is it possible to use Ajax inside light box of scheduler? I am trying to load data dynamically in Combo box using Ajax but i get this java script error “Unspecified error”. Need your assistance.

Thanks,
Karthick K.

Technically yes, you can call any kind of code from set_value handler of form block, but ajax calls mean asynchronous way of data loading, which can be complicated in real life scenarios.

hi,
Actually this is what i did. I have a combo box in light box with data loaded from database. In on Change event i called a java script function called getStoreName(this.value) . Inside this method i am calling jsp file using Ajax where i have another combo box with data filled from database and then i am displaying that combo box into the div element of scheduler by using the code below,

document.getElementById(“storeHide”).innerHTML=xmlhttp.responseText;

Combo box gets displayed in DIV element but i get this java script error “Unspecified error”. Need your assistance.

Thanks,
Karthick K.

Can you provide some kind of demo link , where issue can be reconstructed ?

Can you please explain how to map this uri ,i am very new to this

I am trying to run contact-manager demo in java JSF/MSSql server, having problems with the grid, after calling the method render_table in my servlet, the grid is not populated, the db connection is ok.

I am loading the library from CDN, the following error is showed in the browser:
uncaught exception: [object XMLHttpRequest] dhtmlx.js:9:31412

Is anybody using dhtmlx grid with java ?

following is my servlet script:
public class dhtmlx_Servlet extends HttpServlet {

/**
 * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
 * methods.
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException 
{
    String data = "**** test ****";
    PreparedStatement qps;
    ResultSet rs = null;
    String city = "test";
    String sql;
    Connection conn = null;
    String username = "psv";
    String password = "psv_pw";
    com.dhtmlx.connector.GridConnector gc = null ;
    
    response.setContentType("text/html;charset=UTF-8");
    /*
    
    try {
        InitialContext ctx = new InitialContext();
        DataSource ds = (DataSource) ctx.lookup("jdbc/PsFlowWeb");
        conn = ds.getConnection(username, password);

        sql = "SELECT top 1 *, csDescripcionCiudad as city from TCiudades";
        
        qps = conn.prepareStatement(sql);
        rs = qps.executeQuery();

        if (rs.next()) {
            city = rs.getString("city");
            //response.getWriter().write("---- inside rs.next ----");
        }
        response.getWriter().write(city);
        rs.close();
        qps.close();
        conn.close();
        
    } catch (SQLException ex) {
        Logger.getLogger("DashboardDAO").log(Level.SEVERE, null, ex);
    } catch (Exception ex) {
        Logger.getLogger("DashboardDAO").log(Level.SEVERE, null, ex);
    }
   */
    
    //response.getWriter().write(data);
    
    response.setContentType("text/html;charset=UTF-8");
    
    try (PrintWriter out = response.getWriter()) 
    {
        try 
        {
            InitialContext ctx = new InitialContext();
            DataSource ds = (DataSource) ctx.lookup("jdbc/PsFlowWeb");
            conn = ds.getConnection(username, password);
            gc = new com.dhtmlx.connector.GridConnector(conn);
            gc.servlet(request, response);
            //gc.dynamic_loading(100);
            gc.enable_log("c:/PSFlow/logs/grid.log", true);
            gc.render_table("TCiudades","id","csCodigoCiudad,csDescripcionCiudad,csTipoRiesgo");
        } 
        catch (SQLException | NamingException ex) 
        {
            //Logger.getLogger(SqlServerDAOFactory.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
   
}