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

Regarding Datatable and JSP

Expand Messages
  • manish_it51
    Hi All, I am newbie to YUI User Interface Library. I want to use datatable using following: DataTable Control (beta): XML Data Over XHR With POST I tried a lot
    Message 1 of 4 , Jun 2, 2008
    • 0 Attachment
      Hi All,
      I am newbie to YUI User Interface Library.
      I want to use datatable using following:

      DataTable Control (beta): XML Data Over XHR With POST

      I tried a lot but i get Data Error. can anybody tell me how to
      solve this problem.

      I tried with the given example on YUI site.

      Thanx in advance.

      Thanx & Regards,
      Manish
    • y_lsmith
      ... Manish, Data error can mean a number of things. Is your server responding to the request? With the appropriate and correctly formatted data response? Try
      Message 2 of 4 , Jun 2, 2008
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "manish_it51" <manish_it51@...>
        wrote:
        >
        > Hi All,
        > I am newbie to YUI User Interface Library.
        > I want to use datatable using following:
        >
        > DataTable Control (beta): XML Data Over XHR With POST
        >
        > I tried a lot but i get Data Error. can anybody tell me how to
        > solve this problem.
        >
        > I tried with the given example on YUI site.
        >
        > Thanx in advance.
        >
        > Thanx & Regards,
        > Manish
        >

        Manish,

        Data error can mean a number of things. Is your server responding to
        the request? With the appropriate and correctly formatted data response?

        Try using Firefox + FireBug to verify that the server io is happening
        correctly. If you are seeing the correct response, please post a link
        to the page you're experiencing trouble with and we might be able to
        help you out.

        Luke
      • manish_it51
        ... to ... response? ... happening ... link ... Thanx Luke, i have resolved that error but now datatable is displaying no records found. i have tried with the
        Message 3 of 4 , Jun 3, 2008
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@...> wrote:
          >
          > --- In ydn-javascript@yahoogroups.com, "manish_it51" <manish_it51@>
          > wrote:
          > >
          > > Hi All,
          > > I am newbie to YUI User Interface Library.
          > > I want to use datatable using following:
          > >
          > > DataTable Control (beta): XML Data Over XHR With POST
          > >
          > > I tried a lot but i get Data Error. can anybody tell me how to
          > > solve this problem.
          > >
          > > I tried with the given example on YUI site.
          > >
          > > Thanx in advance.
          > >
          > > Thanx & Regards,
          > > Manish
          > >
          >
          > Manish,
          >
          > Data error can mean a number of things. Is your server responding
          to
          > the request? With the appropriate and correctly formatted data
          response?
          >
          > Try using Firefox + FireBug to verify that the server io is
          happening
          > correctly. If you are seeing the correct response, please post a
          link
          > to the page you're experiencing trouble with and we might be able to
          > help you out.
          >
          > Luke
          >

          Thanx Luke,
          i have resolved that error but now datatable is displaying
          no records found.

          i have tried with the sample example but it was not working
          so i updated and tried as u can see in below code.

          Need your help to create datatable using dynamically generated
          xml response from jsp page.


          my code is as given below:
          <body>
          <div id="xml" >
          </div>
          <script type="text/javascript">
          YAHOO.util.Event.addListener(window, "load", function() {
          YAHOO.example.XHR_XML = new function() {
          var myColumnDefs = [
          {key:"Title"},
          {key:"Phone"},
          {key:"City"}

          ];

          this.myDataSource = new YAHOO.util.DataSource("xhr.jsp?");
          this.myDataSource.connMethodPost = true;
          this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
          this.myDataSource.responseSchema = {
          resultNode: "test",
          fields: ["Title","Phone","City"]
          };

          this.myDataTable = new YAHOO.widget.DataTable("xml", myColumnDefs,
          this.myDataSource);

          };
          });
          -------------xhr.jsp---------------
          <%@ page contentType="text/xml;charset=ISO-8859-1" %>
          <% String phone="333333"; %>
          <?xml version="1.0"?>
          <test>
          <Title>Pizza Depot</Title>
          <Phone><%=phone%></Phone>
          <City>Palanpur</City>
          </test>
        • y_lsmith
          ... Have you tried nesting the entry inside another tag? Pizza Depot
          Message 4 of 4 , Jun 4, 2008
          • 0 Attachment
            --- In ydn-javascript@yahoogroups.com, "manish_it51" <manish_it51@...>
            wrote:
            >
            > --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@> wrote:
            > >
            > > --- In ydn-javascript@yahoogroups.com, "manish_it51" <manish_it51@>
            > > wrote:
            > > >
            > > > Hi All,
            > > > I am newbie to YUI User Interface Library.
            > > > I want to use datatable using following:
            > > >
            > > > DataTable Control (beta): XML Data Over XHR With POST
            > > >
            > > > I tried a lot but i get Data Error. can anybody tell me how to
            > > > solve this problem.
            > > >
            > > > I tried with the given example on YUI site.
            > > >
            > > > Thanx in advance.
            > > >
            > > > Thanx & Regards,
            > > > Manish
            > > >
            > >
            > > Manish,
            > >
            > > Data error can mean a number of things. Is your server responding
            > to
            > > the request? With the appropriate and correctly formatted data
            > response?
            > >
            > > Try using Firefox + FireBug to verify that the server io is
            > happening
            > > correctly. If you are seeing the correct response, please post a
            > link
            > > to the page you're experiencing trouble with and we might be able to
            > > help you out.
            > >
            > > Luke
            > >
            >
            > Thanx Luke,
            > i have resolved that error but now datatable is displaying
            > no records found.
            >
            > i have tried with the sample example but it was not working
            > so i updated and tried as u can see in below code.
            >
            > Need your help to create datatable using dynamically generated
            > xml response from jsp page.
            >
            >
            > my code is as given below:
            > <body>
            > <div id="xml" >
            > </div>
            > <script type="text/javascript">
            > YAHOO.util.Event.addListener(window, "load", function() {
            > YAHOO.example.XHR_XML = new function() {
            > var myColumnDefs = [
            > {key:"Title"},
            > {key:"Phone"},
            > {key:"City"}
            >
            > ];
            >
            > this.myDataSource = new YAHOO.util.DataSource("xhr.jsp?");
            > this.myDataSource.connMethodPost = true;
            > this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
            > this.myDataSource.responseSchema = {
            > resultNode: "test",
            > fields: ["Title","Phone","City"]
            > };
            >
            > this.myDataTable = new YAHOO.widget.DataTable("xml", myColumnDefs,
            > this.myDataSource);
            >
            > };
            > });
            > -------------xhr.jsp---------------
            > <%@ page contentType="text/xml;charset=ISO-8859-1" %>
            > <% String phone="333333"; %>
            > <?xml version="1.0"?>
            > <test>
            > <Title>Pizza Depot</Title>
            > <Phone><%=phone%></Phone>
            > <City>Palanpur</City>
            > </test>
            >


            Have you tried nesting the <test> entry inside another tag?
            <?xml version="1.0"?>
            <response>
            <results>
            <test>
            <Title>Pizza Depot</Title>
            <Phone><%=phone%></Phone>
            <City>Palanpur</City>
            </test>
            </results>
            </response>
          Your message has been successfully submitted and would be delivered to recipients shortly.