Loading ...
Sorry, an error occurred while loading the content.

Data Error

Expand Messages
  • razagill
    I have a servlet and a jsp page (in which i have put the YUI datatable). But I am getting the Error Data Error in the Grid. The servlet is outputting an xml
    Message 1 of 8 , Nov 14, 2008
    • 0 Attachment
      I have a servlet and a jsp page (in which i have put the YUI
      datatable). But I am getting the Error "Data Error" in the Grid.

      The servlet is outputting an xml file, here is the code:

      RStoXML rsxml = new RStoXML(rs, "ResultSet", "Result");
      Document jDOMDoc = rsxml.build();
      rs.close();
      XMLOutputter outputter = new XMLOutputter() ;
      StringWriter writer = new StringWriter() ;
      outputter.output( jDOMDoc, writer );
      writer.close() ;
      response.setContentType("text/xml");
      response.getWriter().println(writer.toString());

      This servlet is working fine and I see the XML file in the browswer.

      In the JSP page i have the datatable code as follows:

      <script>
      // A DIV with id "cal1Container" is already on the page
      function LoadCall(){
      var myColumnHeaders = [
      {key:"id",text:"ID"},
      {key:"Name",text:"Name"},
      {key:"Department",text:"Department"},
      {key:"Age",text:"Age"}
      ];
      var myColumnSet = new YAHOO.widget.ColumnSet(myColumnHeaders);


      var myDataSource = new YAHOO.util.DataSource("/GridController");

      myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;

      myDataSource.responseSchema = {
      resultNode: "Result",
      fields: ["ID","Name","Department","Age"] // Field names
      };


      var oConfigs = {
      caption:"Example: Paginated Over XHR",


      pageCurrent: 1,
      rowsPerPage: 100,
      startRecordIndex: 1,
      pageLinksLength: 10,
      rowsPerPageDropdown: [25,50,100,500]
      };

      var myDataTable = new YAHOO.widget.DataTable("callContainer",
      myColumnSet, myDataSource, oConfigs);

      }
      </script>
    • Satyam
      Can you see what is it that the browser receives? In Firefox with Firebug you would do that in the Net tab. Sometimes an unexpected error makes the server
      Message 2 of 8 , Nov 14, 2008
      • 0 Attachment
        Can you see what is it that the browser receives? In Firefox with
        Firebug you would do that in the Net tab. Sometimes an unexpected error
        makes the server issue a diagnostic message instead of the expected
        output and, of course, that error does not parse as valid XML. In
        versions prior to 2.6 when not specifying an initialRequest argument
        would produce an error if the URL for the DataSource did not have a
        query mark at the end. This is fixed, but something else might be going
        on. If the error says Data Error, you have to actually see the data in
        error, the code that is meant to produce it is not a good indication.

        Satyam


        razagill wrote:
        > I have a servlet and a jsp page (in which i have put the YUI
        > datatable). But I am getting the Error "Data Error" in the Grid.
        >
        > The servlet is outputting an xml file, here is the code:
        >
        > RStoXML rsxml = new RStoXML(rs, "ResultSet", "Result");
        > Document jDOMDoc = rsxml.build();
        > rs.close();
        > XMLOutputter outputter = new XMLOutputter() ;
        > StringWriter writer = new StringWriter() ;
        > outputter.output( jDOMDoc, writer );
        > writer.close() ;
        > response.setContentType("text/xml");
        > response.getWriter().println(writer.toString());
        >
        > This servlet is working fine and I see the XML file in the browswer.
        >
        > In the JSP page i have the datatable code as follows:
        >
        > <script>
        > // A DIV with id "cal1Container" is already on the page
        > function LoadCall(){
        > var myColumnHeaders = [
        > {key:"id",text:"ID"},
        > {key:"Name",text:"Name"},
        > {key:"Department",text:"Department"},
        > {key:"Age",text:"Age"}
        > ];
        > var myColumnSet = new YAHOO.widget.ColumnSet(myColumnHeaders);
        >
        >
        > var myDataSource = new YAHOO.util.DataSource("/GridController");
        >
        > myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
        >
        > myDataSource.responseSchema = {
        > resultNode: "Result",
        > fields: ["ID","Name","Department","Age"] // Field names
        > };
        >
        >
        > var oConfigs = {
        > caption:"Example: Paginated Over XHR",
        >
        >
        > pageCurrent: 1,
        > rowsPerPage: 100,
        > startRecordIndex: 1,
        > pageLinksLength: 10,
        > rowsPerPageDropdown: [25,50,100,500]
        > };
        >
        > var myDataTable = new YAHOO.widget.DataTable("callContainer",
        > myColumnSet, myDataSource, oConfigs);
        >
        > }
        > </script>
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - http://www.avg.com
        > Version: 8.0.175 / Virus Database: 270.9.2/1785 - Release Date: 13/11/2008 9:12
        >
        >
      • Eric Miraglia
        Razagill, One useful step to take next would be to switch to the debug versions of your YUI files and then watch your Firebug console to see if you get a
        Message 3 of 8 , Nov 14, 2008
        • 0 Attachment
          Razagill,

          One useful step to take next would be to switch to the debug versions of your YUI files and then watch your Firebug console to see if you get a meaningful error message.  (You may also want to go to the script tab of Firebug, then to the options menu for that tab, and enable "break on all errors").

          Debug files are easy to get and use.  You can use the Dependency Configurator to grab the right URL and load them from Yahoo's servers:


          Regards,
          Eric


          On Nov 14, 2008, at 7:12 AM, razagill wrote:

          I have a servlet and a jsp page (in which i have put the YUI
          datatable). But I am getting the Error "Data Error" in the Grid.

          The servlet is outputting an xml file, here is the code:

          RStoXML rsxml = new RStoXML(rs, "ResultSet", "Result");
          Document jDOMDoc = rsxml.build( );
          rs.close();
          XMLOutputter outputter = new XMLOutputter( ) ;
          StringWriter writer = new StringWriter( ) ;
          outputter.output( jDOMDoc, writer );
          writer.close( ) ;
          response.setContent Type("text/ xml");
          response.getWriter( ).println( writer.toString( ));

          This servlet is working fine and I see the XML file in the browswer.

          In the JSP page i have the datatable code as follows:

          <script>
          // A DIV with id "cal1Container" is already on the page
          function LoadCall(){
          var myColumnHeaders = [
          {key:"id",text: "ID"},
          {key:"Name", text:"Name" },
          {key:"Department" ,text:"Departmen t"},
          {key:"Age",text: "Age"}
          ];
          var myColumnSet = new YAHOO.widget. ColumnSet( myColumnHeaders) ;

          var myDataSource = new YAHOO.util.DataSour ce("/GridControl ler");

          myDataSource. responseType = YAHOO.util.DataSour ce.TYPE_XML;

          myDataSource. responseSchema = {
          resultNode: "Result", 
          fields: ["ID","Name" ,"Department" ,"Age"] // Field names
          };

          var oConfigs = {
          caption:"Example: Paginated Over XHR",


          pageCurrent: 1,
          rowsPerPage: 100,
          startRecordIndex: 1,
          pageLinksLength: 10,
          rowsPerPageDropdown : [25,50,100,500]
          };

          var myDataTable = new YAHOO.widget. DataTable( "callContainer" ,
          myColumnSet, myDataSource, oConfigs);

          }
          </script>


        • razagill
          Hi, I am unable to find the specific error even with firebug. Actually, i am not too much into javascript. I am mainly a JSP/Servlet application developer. And
          Message 4 of 8 , Nov 14, 2008
          • 0 Attachment
            Hi,
            I am unable to find the specific error even with firebug. Actually,
            i am not too much into javascript. I am mainly a JSP/Servlet
            application developer. And this is my first time using YUI datatable.
            The code that I have provided is a working example except with a
            difference of a variable named "initialRequest". I am not sure what's
            it for in the datatable. Is it the variable that contain the Request
            string for the server page (that is providing the xml)?If yes, then
            how can use it with my servlet which is returning a complete XML as it is?


            --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
            >
            > Razagill,
            >
            > One useful step to take next would be to switch to the debug versions
            > of your YUI files and then watch your Firebug console to see if you
            > get a meaningful error message. (You may also want to go to the
            > script tab of Firebug, then to the options menu for that tab, and
            > enable "break on all errors").
            >
            > Debug files are easy to get and use. You can use the Dependency
            > Configurator to grab the right URL and load them from Yahoo's servers:
            >
            >
            http://developer.yahoo.com/yui/articles/hosting/?datatable&DEBUG&norollup
            >
            > Regards,
            > Eric
            >
            >
            > On Nov 14, 2008, at 7:12 AM, razagill wrote:
            >
            > > I have a servlet and a jsp page (in which i have put the YUI
            > > datatable). But I am getting the Error "Data Error" in the Grid.
            > >
            > > The servlet is outputting an xml file, here is the code:
            > >
            > > RStoXML rsxml = new RStoXML(rs, "ResultSet", "Result");
            > > Document jDOMDoc = rsxml.build();
            > > rs.close();
            > > XMLOutputter outputter = new XMLOutputter() ;
            > > StringWriter writer = new StringWriter() ;
            > > outputter.output( jDOMDoc, writer );
            > > writer.close() ;
            > > response.setContentType("text/xml");
            > > response.getWriter().println(writer.toString());
            > >
            > > This servlet is working fine and I see the XML file in the browswer.
            > >
            > > In the JSP page i have the datatable code as follows:
            > >
            > > <script>
            > > // A DIV with id "cal1Container" is already on the page
            > > function LoadCall(){
            > > var myColumnHeaders = [
            > > {key:"id",text:"ID"},
            > > {key:"Name",text:"Name"},
            > > {key:"Department",text:"Department"},
            > > {key:"Age",text:"Age"}
            > > ];
            > > var myColumnSet = new YAHOO.widget.ColumnSet(myColumnHeaders);
            > >
            > > var myDataSource = new YAHOO.util.DataSource("/GridController");
            > >
            > > myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
            > >
            > > myDataSource.responseSchema = {
            > > resultNode: "Result",
            > > fields: ["ID","Name","Department","Age"] // Field names
            > > };
            > >
            > > var oConfigs = {
            > > caption:"Example: Paginated Over XHR",
            > >
            > >
            > > pageCurrent: 1,
            > > rowsPerPage: 100,
            > > startRecordIndex: 1,
            > > pageLinksLength: 10,
            > > rowsPerPageDropdown: [25,50,100,500]
            > > };
            > >
            > > var myDataTable = new YAHOO.widget.DataTable("callContainer",
            > > myColumnSet, myDataSource, oConfigs);
            > >
            > > }
            > > </script>
            > >
            > >
            > >
            >
          • Eric Miraglia
            The initialRequest property is used to provide the parameters for the initial server request -- the querystring values, typically, for the initial sort, start
            Message 5 of 8 , Nov 14, 2008
            • 0 Attachment
              The initialRequest property is used to provide the parameters for the initial server request -- the querystring values, typically, for the initial sort, start index, etc.

              If your servlet doesn't require the querystring values, than initialRequest isn't important.

              Regards,
              Eric


              On Nov 14, 2008, at 8:53 AM, razagill wrote:

              Hi,
              I am unable to find the specific error even with firebug. Actually,
              i am not too much into javascript. I am mainly a JSP/Servlet
              application developer. And this is my first time using YUI datatable.
              The code that I have provided is a working example except with a
              difference of a variable named "initialRequest" . I am not sure what's
              it for in the datatable. Is it the variable that contain the Request
              string for the server page (that is providing the xml)?If yes, then
              how can use it with my servlet which is returning a complete XML as it is?

              --- In ydn-javascript@ yahoogroups. com, Eric Miraglia <miraglia@.. .> wrote:
              >
              > Razagill,
              > 
              > One useful step to take next would be to switch to the debug versions 
              > of your YUI files and then watch your Firebug console to see if you 
              > get a meaningful error message. (You may also want to go to the 
              > script tab of Firebug, then to the options menu for that tab, and 
              > enable "break on all errors").
              > 
              > Debug files are easy to get and use. You can use the Dependency 
              > Configurator to grab the right URL and load them from Yahoo's servers:
              > 
              >
              http://developer. yahoo.com/ yui/articles/ hosting/? datatable& DEBUG&norollup
              > 
              > Regards,
              > Eric
              > 
              > 
              > On Nov 14, 2008, at 7:12 AM, razagill wrote:
              > 
              > > I have a servlet and a jsp page (in which i have put the YUI
              > > datatable). But I am getting the Error "Data Error" in the Grid.
              > >
              > > The servlet is outputting an xml file, here is the code:
              > >
              > > RStoXML rsxml = new RStoXML(rs, "ResultSet", "Result");
              > > Document jDOMDoc = rsxml.build( );
              > > rs.close();
              > > XMLOutputter outputter = new XMLOutputter( ) ;
              > > StringWriter writer = new StringWriter( ) ;
              > > outputter.output( jDOMDoc, writer );
              > > writer.close( ) ;
              > > response.setContent Type("text/ xml");
              > > response.getWriter( ).println( writer.toString( ));
              > >
              > > This servlet is working fine and I see the XML file in the browswer.
              > >
              > > In the JSP page i have the datatable code as follows:
              > >
              > > <script>
              > > // A DIV with id "cal1Container" is already on the page
              > > function LoadCall(){
              > > var myColumnHeaders = [
              > > {key:"id",text: "ID"},
              > > {key:"Name", text:"Name" },
              > > {key:"Department" ,text:"Departmen t"},
              > > {key:"Age",text: "Age"}
              > > ];
              > > var myColumnSet = new YAHOO.widget. ColumnSet( myColumnHeaders) ;
              > >
              > > var myDataSource = new YAHOO.util.DataSour ce("/GridControl ler");
              > >
              > > myDataSource. responseType = YAHOO.util.DataSour ce.TYPE_XML;
              > >
              > > myDataSource. responseSchema = {
              > > resultNode: "Result",
              > > fields: ["ID","Name" ,"Department" ,"Age"] // Field names
              > > };
              > >
              > > var oConfigs = {
              > > caption:"Example: Paginated Over XHR",
              > >
              > >
              > > pageCurrent: 1,
              > > rowsPerPage: 100,
              > > startRecordIndex: 1,
              > > pageLinksLength: 10,
              > > rowsPerPageDropdown : [25,50,100,500]
              > > };
              > >
              > > var myDataTable = new YAHOO.widget. DataTable( "callContainer" ,
              > > myColumnSet, myDataSource, oConfigs);
              > >
              > > }
              > > </script>
              > >
              > >
              > >
              >


            • razagill
              Okay, I ve found an error. It s in the constructor of the datasource. It says ERROR_DATAINVALID and also ERROR_DATANULL . So i guess the problem is
              Message 6 of 8 , Nov 14, 2008
              • 0 Attachment
                Okay, I've found an error. It's in the constructor of the datasource.
                It says "ERROR_DATAINVALID" and also "ERROR_DATANULL". So i guess the
                problem is somewhere in the servlet which is outputting an XML file.
                Do i have to parse it for the datatable constructor?

                --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
                >
                > The initialRequest property is used to provide the parameters for the
                > initial server request -- the querystring values, typically, for the
                > initial sort, start index, etc.
                >
                > If your servlet doesn't require the querystring values, than
                > initialRequest isn't important.
                >
                > Regards,
                > Eric
                >
                >
                > On Nov 14, 2008, at 8:53 AM, razagill wrote:
                >
                > > Hi,
                > > I am unable to find the specific error even with firebug. Actually,
                > > i am not too much into javascript. I am mainly a JSP/Servlet
                > > application developer. And this is my first time using YUI datatable.
                > > The code that I have provided is a working example except with a
                > > difference of a variable named "initialRequest". I am not sure what's
                > > it for in the datatable. Is it the variable that contain the Request
                > > string for the server page (that is providing the xml)?If yes, then
                > > how can use it with my servlet which is returning a complete XML as
                > > it is?
                > >
                > > --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@>
                > > wrote:
                > > >
                > > > Razagill,
                > > >
                > > > One useful step to take next would be to switch to the debug
                > > versions
                > > > of your YUI files and then watch your Firebug console to see if you
                > > > get a meaningful error message. (You may also want to go to the
                > > > script tab of Firebug, then to the options menu for that tab, and
                > > > enable "break on all errors").
                > > >
                > > > Debug files are easy to get and use. You can use the Dependency
                > > > Configurator to grab the right URL and load them from Yahoo's
                > > servers:
                > > >
                > > >
                > >
                http://developer.yahoo.com/yui/articles/hosting/?datatable&DEBUG&norollup
                > > >
                > > > Regards,
                > > > Eric
                > > >
                > > >
                > > > On Nov 14, 2008, at 7:12 AM, razagill wrote:
                > > >
                > > > > I have a servlet and a jsp page (in which i have put the YUI
                > > > > datatable). But I am getting the Error "Data Error" in the Grid.
                > > > >
                > > > > The servlet is outputting an xml file, here is the code:
                > > > >
                > > > > RStoXML rsxml = new RStoXML(rs, "ResultSet", "Result");
                > > > > Document jDOMDoc = rsxml.build();
                > > > > rs.close();
                > > > > XMLOutputter outputter = new XMLOutputter() ;
                > > > > StringWriter writer = new StringWriter() ;
                > > > > outputter.output( jDOMDoc, writer );
                > > > > writer.close() ;
                > > > > response.setContentType("text/xml");
                > > > > response.getWriter().println(writer.toString());
                > > > >
                > > > > This servlet is working fine and I see the XML file in the
                > > browswer.
                > > > >
                > > > > In the JSP page i have the datatable code as follows:
                > > > >
                > > > > <script>
                > > > > // A DIV with id "cal1Container" is already on the page
                > > > > function LoadCall(){
                > > > > var myColumnHeaders = [
                > > > > {key:"id",text:"ID"},
                > > > > {key:"Name",text:"Name"},
                > > > > {key:"Department",text:"Department"},
                > > > > {key:"Age",text:"Age"}
                > > > > ];
                > > > > var myColumnSet = new YAHOO.widget.ColumnSet(myColumnHeaders);
                > > > >
                > > > > var myDataSource = new YAHOO.util.DataSource("/GridController");
                > > > >
                > > > > myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
                > > > >
                > > > > myDataSource.responseSchema = {
                > > > > resultNode: "Result",
                > > > > fields: ["ID","Name","Department","Age"] // Field names
                > > > > };
                > > > >
                > > > > var oConfigs = {
                > > > > caption:"Example: Paginated Over XHR",
                > > > >
                > > > >
                > > > > pageCurrent: 1,
                > > > > rowsPerPage: 100,
                > > > > startRecordIndex: 1,
                > > > > pageLinksLength: 10,
                > > > > rowsPerPageDropdown: [25,50,100,500]
                > > > > };
                > > > >
                > > > > var myDataTable = new YAHOO.widget.DataTable("callContainer",
                > > > > myColumnSet, myDataSource, oConfigs);
                > > > >
                > > > > }
                > > > > </script>
                > > > >
                > > > >
                > > > >
                > > >
                > >
                > >
                > >
                >
              • razagill
                Or do I have to set some property for the Datasource apart from the TYP_XML? ... the ... datatable. ... what s ... as ... if you ...
                Message 7 of 8 , Nov 14, 2008
                • 0 Attachment
                  Or do I have to set some property for the Datasource apart from the
                  TYP_XML?

                  --- In ydn-javascript@yahoogroups.com, "razagill" <razagill@...> wrote:
                  >
                  > Okay, I've found an error. It's in the constructor of the datasource.
                  > It says "ERROR_DATAINVALID" and also "ERROR_DATANULL". So i guess the
                  > problem is somewhere in the servlet which is outputting an XML file.
                  > Do i have to parse it for the datatable constructor?
                  >
                  > --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@> wrote:
                  > >
                  > > The initialRequest property is used to provide the parameters for
                  the
                  > > initial server request -- the querystring values, typically, for the
                  > > initial sort, start index, etc.
                  > >
                  > > If your servlet doesn't require the querystring values, than
                  > > initialRequest isn't important.
                  > >
                  > > Regards,
                  > > Eric
                  > >
                  > >
                  > > On Nov 14, 2008, at 8:53 AM, razagill wrote:
                  > >
                  > > > Hi,
                  > > > I am unable to find the specific error even with firebug. Actually,
                  > > > i am not too much into javascript. I am mainly a JSP/Servlet
                  > > > application developer. And this is my first time using YUI
                  datatable.
                  > > > The code that I have provided is a working example except with a
                  > > > difference of a variable named "initialRequest". I am not sure
                  what's
                  > > > it for in the datatable. Is it the variable that contain the Request
                  > > > string for the server page (that is providing the xml)?If yes, then
                  > > > how can use it with my servlet which is returning a complete XML
                  as
                  > > > it is?
                  > > >
                  > > > --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@>
                  > > > wrote:
                  > > > >
                  > > > > Razagill,
                  > > > >
                  > > > > One useful step to take next would be to switch to the debug
                  > > > versions
                  > > > > of your YUI files and then watch your Firebug console to see
                  if you
                  > > > > get a meaningful error message. (You may also want to go to the
                  > > > > script tab of Firebug, then to the options menu for that tab, and
                  > > > > enable "break on all errors").
                  > > > >
                  > > > > Debug files are easy to get and use. You can use the Dependency
                  > > > > Configurator to grab the right URL and load them from Yahoo's
                  > > > servers:
                  > > > >
                  > > > >
                  > > >
                  >
                  http://developer.yahoo.com/yui/articles/hosting/?datatable&DEBUG&norollup
                  > > > >
                  > > > > Regards,
                  > > > > Eric
                  > > > >
                  > > > >
                  > > > > On Nov 14, 2008, at 7:12 AM, razagill wrote:
                  > > > >
                  > > > > > I have a servlet and a jsp page (in which i have put the YUI
                  > > > > > datatable). But I am getting the Error "Data Error" in the Grid.
                  > > > > >
                  > > > > > The servlet is outputting an xml file, here is the code:
                  > > > > >
                  > > > > > RStoXML rsxml = new RStoXML(rs, "ResultSet", "Result");
                  > > > > > Document jDOMDoc = rsxml.build();
                  > > > > > rs.close();
                  > > > > > XMLOutputter outputter = new XMLOutputter() ;
                  > > > > > StringWriter writer = new StringWriter() ;
                  > > > > > outputter.output( jDOMDoc, writer );
                  > > > > > writer.close() ;
                  > > > > > response.setContentType("text/xml");
                  > > > > > response.getWriter().println(writer.toString());
                  > > > > >
                  > > > > > This servlet is working fine and I see the XML file in the
                  > > > browswer.
                  > > > > >
                  > > > > > In the JSP page i have the datatable code as follows:
                  > > > > >
                  > > > > > <script>
                  > > > > > // A DIV with id "cal1Container" is already on the page
                  > > > > > function LoadCall(){
                  > > > > > var myColumnHeaders = [
                  > > > > > {key:"id",text:"ID"},
                  > > > > > {key:"Name",text:"Name"},
                  > > > > > {key:"Department",text:"Department"},
                  > > > > > {key:"Age",text:"Age"}
                  > > > > > ];
                  > > > > > var myColumnSet = new YAHOO.widget.ColumnSet(myColumnHeaders);
                  > > > > >
                  > > > > > var myDataSource = new YAHOO.util.DataSource("/GridController");
                  > > > > >
                  > > > > > myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
                  > > > > >
                  > > > > > myDataSource.responseSchema = {
                  > > > > > resultNode: "Result",
                  > > > > > fields: ["ID","Name","Department","Age"] // Field names
                  > > > > > };
                  > > > > >
                  > > > > > var oConfigs = {
                  > > > > > caption:"Example: Paginated Over XHR",
                  > > > > >
                  > > > > >
                  > > > > > pageCurrent: 1,
                  > > > > > rowsPerPage: 100,
                  > > > > > startRecordIndex: 1,
                  > > > > > pageLinksLength: 10,
                  > > > > > rowsPerPageDropdown: [25,50,100,500]
                  > > > > > };
                  > > > > >
                  > > > > > var myDataTable = new YAHOO.widget.DataTable("callContainer",
                  > > > > > myColumnSet, myDataSource, oConfigs);
                  > > > > >
                  > > > > > }
                  > > > > > </script>
                  > > > > >
                  > > > > >
                  > > > > >
                  > > > >
                  > > >
                  > > >
                  > > >
                  > >
                  >
                • Eric Miraglia
                  razagill, Definitely refer to the XML examples on the YUI site...for example: http://developer.yahoo.com/yui/examples/datatable/dt_xhrpostxml.html Make sure
                  Message 8 of 8 , Nov 14, 2008
                  • 0 Attachment
                    razagill,

                    Definitely refer to the XML examples on the YUI site...for example:


                    Make sure that you're doing all the things Jenny does in that example, that you're setting the right header in your servlet for the XML response, etc.  If that fails, please post a URL and hopefully someone on the list will see something you're missing.

                    Regards,
                    Eric



                    On Nov 14, 2008, at 9:57 AM, razagill wrote:

                    Or do I have to set some property for the Datasource apart from the
                    TYP_XML?

                    --- In ydn-javascript@ yahoogroups. com, "razagill" <razagill@.. .> wrote:
                    >
                    > Okay, I've found an error. It's in the constructor of the datasource.
                    > It says "ERROR_DATAINVALID" and also "ERROR_DATANULL" . So i guess the
                    > problem is somewhere in the servlet which is outputting an XML file.
                    > Do i have to parse it for the datatable constructor?
                    > 
                    > --- In ydn-javascript@ yahoogroups. com, Eric Miraglia <miraglia@> wrote:
                    > >
                    > > The initialRequest property is used to provide the parameters for
                    the 
                    > > initial server request -- the querystring values, typically, for the 
                    > > initial sort, start index, etc.
                    > > 
                    > > If your servlet doesn't require the querystring values, than 
                    > > initialRequest isn't important.
                    > > 
                    > > Regards,
                    > > Eric
                    > > 
                    > > 
                    > > On Nov 14, 2008, at 8:53 AM, razagill wrote:
                    > > 
                    > > > Hi,
                    > > > I am unable to find the specific error even with firebug. Actually,
                    > > > i am not too much into javascript. I am mainly a JSP/Servlet
                    > > > application developer. And this is my first time using YUI
                    datatable.
                    > > > The code that I have provided is a working example except with a
                    > > > difference of a variable named "initialRequest" . I am not sure
                    what's
                    > > > it for in the datatable. Is it the variable that contain the Request
                    > > > string for the server page (that is providing the xml)?If yes, then
                    > > > how can use it with my servlet which is returning a complete XML
                    as 
                    > > > it is?
                    > > >
                    > > > --- In ydn-javascript@ yahoogroups. com, Eric Miraglia <miraglia@> 
                    > > > wrote:
                    > > > >
                    > > > > Razagill,
                    > > > >
                    > > > > One useful step to take next would be to switch to the debug 
                    > > > versions
                    > > > > of your YUI files and then watch your Firebug console to see
                    if you
                    > > > > get a meaningful error message. (You may also want to go to the
                    > > > > script tab of Firebug, then to the options menu for that tab, and
                    > > > > enable "break on all errors").
                    > > > >
                    > > > > Debug files are easy to get and use. You can use the Dependency
                    > > > > Configurator to grab the right URL and load them from Yahoo's 
                    > > > servers:
                    > > > >
                    > > > >
                    > > >
                    >
                    http://developer. yahoo.com/ yui/articles/ hosting/? datatable& DEBUG&norollup
                    > > > >
                    > > > > Regards,
                    > > > > Eric
                    > > > >
                    > > > >
                    > > > > On Nov 14, 2008, at 7:12 AM, razagill wrote:
                    > > > >
                    > > > > > I have a servlet and a jsp page (in which i have put the YUI
                    > > > > > datatable). But I am getting the Error "Data Error" in the Grid.
                    > > > > >
                    > > > > > The servlet is outputting an xml file, here is the code:
                    > > > > >
                    > > > > > RStoXML rsxml = new RStoXML(rs, "ResultSet", "Result");
                    > > > > > Document jDOMDoc = rsxml.build( );
                    > > > > > rs.close();
                    > > > > > XMLOutputter outputter = new XMLOutputter( ) ;
                    > > > > > StringWriter writer = new StringWriter( ) ;
                    > > > > > outputter.output( jDOMDoc, writer );
                    > > > > > writer.close( ) ;
                    > > > > > response.setContent Type("text/ xml");
                    > > > > > response.getWriter( ).println( writer.toString( ));
                    > > > > >
                    > > > > > This servlet is working fine and I see the XML file in the 
                    > > > browswer.
                    > > > > >
                    > > > > > In the JSP page i have the datatable code as follows:
                    > > > > >
                    > > > > > <script>
                    > > > > > // A DIV with id "cal1Container" is already on the page
                    > > > > > function LoadCall(){
                    > > > > > var myColumnHeaders = [
                    > > > > > {key:"id",text: "ID"},
                    > > > > > {key:"Name", text:"Name" },
                    > > > > > {key:"Department" ,text:"Departmen t"},
                    > > > > > {key:"Age",text: "Age"}
                    > > > > > ];
                    > > > > > var myColumnSet = new YAHOO.widget. ColumnSet( myColumnHeaders) ;
                    > > > > >
                    > > > > > var myDataSource = new YAHOO.util.DataSour ce("/GridControl ler");
                    > > > > >
                    > > > > > myDataSource. responseType = YAHOO.util.DataSour ce.TYPE_XML;
                    > > > > >
                    > > > > > myDataSource. responseSchema = {
                    > > > > > resultNode: "Result",
                    > > > > > fields: ["ID","Name" ,"Department" ,"Age"] // Field names
                    > > > > > };
                    > > > > >
                    > > > > > var oConfigs = {
                    > > > > > caption:"Example: Paginated Over XHR",
                    > > > > >
                    > > > > >
                    > > > > > pageCurrent: 1,
                    > > > > > rowsPerPage: 100,
                    > > > > > startRecordIndex: 1,
                    > > > > > pageLinksLength: 10,
                    > > > > > rowsPerPageDropdown : [25,50,100,500]
                    > > > > > };
                    > > > > >
                    > > > > > var myDataTable = new YAHOO.widget. DataTable( "callContainer" ,
                    > > > > > myColumnSet, myDataSource, oConfigs);
                    > > > > >
                    > > > > > }
                    > > > > > </script>
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > >
                    > > >
                    > > >
                    > > >
                    > >
                    >


                  Your message has been successfully submitted and would be delivered to recipients shortly.