Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DataSource not pulling data

    I havethis code:
    <code>
    isc.DataSource.create({
    ID:"countryDS",
    dataFormat:"xml",
    dataURL:"http://localhost/beltrailway/accidents/forms/accidents.asp?methodexecute=mtest&datarequest=xml",
    recordXPath:"//country",
    fields:[
    {name:"countryCode", title:"Code"},
    {name:"countryName", title:"Country"},
    {name:"independence", title:"Nationhood", type:"date"},
    {name:"population", title:"Population", type:"integer"},
    {name:"gdp", title:"GDP", type:"float"}
    ]
    });
    </code>
    it does not look like it pulls data. If run data call in the browser I am getting XML data back. Can you help, please?

    #2
    Actually I think it goes to my ASP, but I am getting back an error #12007.

    Comment


      #3
      Never mind, I got it working.
      Still trying to understand what is a way of extracting data submitted to an asp page by DynamicForm.saveData(). Is it an XML doc, object collection, or something else. Does it say anything about it in the docs?

      Comment


        #4
        Take a look at the second half of the client-side data integration overview, specifically the dataProtocol property.

        Comment


          #5
          I see, but let me make sure I understand it correctly. If I dont use SAOP or WSDL then on the server I am extracting data using form's object? Just like regular html form?

          Comment


            #6
            Yes that's right, and you'd set the dataProtocol to "getParams" or "postParams", as described here

            Comment


              #7
              Is there the default value?

              Comment


                #8
                Can I still send data to the server in XML format if I dont use Web services?

                Comment


                  #9
                  Yes, typical practice is to send it as a normal HTTP parameter.

                  Ideally, what XML data would you like to send?

                  Comment


                    #10
                    The whole form collection. Controls with names and values for easy extraction on the server. Is something like this available on the client site that I can send to the backend?

                    Comment


                      #11
                      <normal HTTP parameter
                      I thought I could access it via Request object on the server but it did not work for me. I am asking about that in another message here on the forum.

                      Comment


                        #12
                        As previously mentioned, with dataProtocol "postParams" or "getParams", SmartClient submits data like a normal HTML form. Since you are using "postParams" the collection of form values is already available as Request.Form. There are many tutorials on how to deal with ordinary form values in ASP, eg this one:

                        http://www.w3schools.com/asp/showasp.asp?filename=demo_simpleform

                        If for some reason you actually need to receive the values as XML, you can use DataSource.xmlSerialize() and DataSource.transformRequest() to do so, but its a more complicated approach.

                        Comment


                          #13
                          I am checking Request.Form.Count on the server and it = 0.

                          Comment


                            #14
                            I have just tested all my server code with a simple ASP page that submits a form into an asp page I am using with your product. I was able to see values from form's collection with no problem at all. Why it's not working with SmartClient?

                            Comment


                              #15
                              Hi Mark,

                              Probably the next step is to post your complete client-side code, however, for a sanity check, try setting dataProtocol to "getParams" instead, and using the Request.QueryString collection instead of Request.Form, as shown here:

                              http://www.w3schools.com/asp/showasp.asp?filename=demo_reqquery

                              Comment

                              Working...
                              X