Forum Post: RE: jsdo synchronous xmlhttprequest

Status
Not open for further replies.
A

agent_008_nl

Guest
After close reading the code (see below for a copy) in the mentioned documentation link I do not understand which problem it solves compared to the code in the old progress.data.session. In fact the execution of the calls is still synchronous. At first after the catalog json has been loaded from the webserver you can start loading a first page of data. I don't know what happens with the GET of home.html, in the old progress.data.session it was fetched even three times synchronously from the webserver after navigating to the URL. I'm trying to solve the same problem for the extra data I need when fetching a first page of data (I need to fetch a dataset with - for now, more to follow - validations). See community.progress.com/.../16826.aspx last message. Ideal for UX would be *only one* roundtrip after navigating to a URL. And why shouldn't this be doable. rauchg.com/.../7-principles-of-rich-web-applications korynunn.wordpress.com/.../deploying-a-web-app-in-14-days-no-html Again something for the DRS (dark room sessions) aka the CCS? Regards, Stefan. var session; /* create jsdoSession */ session = new progress.data.JSDOSession( { serviceURI: "http://localhost/CustService", authenticationModel: progress.data.Session.AUTH_TYPE_FORM }; /* create login screen (using UI defined in HTML file) */ window.loginView = kendo.observable( { submit: function() { var loginParams = { username: this.username, password: this.password) }; /* log in (also loads CustService.json if it succeeds) */ session.login(loginParams ).done( // Logged in function(session, result, info) { session.addCatalog("http://localhost/.../CustService.json" ).done( // JSDO catalog loaded function(session, result, details){ /* success function – create grid and datasource */ $("#grid").kendoGrid( { dataSource: { type: "jsdo", transport: { jsdo: { resourceName: "Customer" } }, error: function(e) { console.log("Error: ", e); } }, /* etc., other kendoGrid properties */ }; /* switch UI to show grid */ window.location.href = "#grid"; }).fail( // JSDO catalog not loaded function(session, result, details){ alert("JSDO catalog failed to load"); }); //JSDOSession addCatalog() }).fail( // Not logged in function(session, result, info) { /* display error message, stay on login screen */ alert("Login failed"); }); // JSDOSession login() } // observable submit method } ); // kendo.observable

Continue reading...
 
Status
Not open for further replies.
Top