[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Choosing Web Development Technology

Status
Not open for further replies.
G

goo

Guest
As an example . HTML (webserver) $.ajax({ type: "POST", data: {id:"XXXttXX"}, dataType: "json", url: " localhost/.../customer.r", success: function(data,textStatus, JQxhr) {myReceiveData(data);}, error: function(JQxhr,textStatus,errorThrown) {alert("WHAT!! – does not happen…" + errorThrown);} }) Webspeed: Customer.r (server/backoffice) {src/web2/wrap-cgi.i} /* ReceivingFields: Fields we receives from calling HTML current=1&rowCount=10&sort[sender]=asc&searchPhrase=&id=b0df282a-0d67-40e5-8558-c9e93b7befed */ output-content-type ( "application/json" :U). fix-codepage ( lc ) = 'UTF-8' . ReceivingFields = string ( web-context : form-input ). run JBoxLoadLib.p ( "JBoxASlib.p,JBoxUiLib.p" ). oQuery = new JBoxQuery( 'Customer;CustNum;Name' ). // oQuery:InitFilterGroup( "custnumgroup" , "AND" ). // oQuery:addFilterGroupCriteria( "custnumgroup" , "and" , "custnum" , "gt" , "10" ). // oQuery:addFilterGroupCriteria( "custnumgroup" , "and" , "custnum" , "lt" , "400" ). oQuery:setFilter( "name" , "begins" , "a" ). //oQuery:setFilter('custnum,name','gt,begins','100|a'). oQuery:rowsToBatch = 10 . /** Number in batch*/ oQuery:setQuerySort( 'custnum;desc' ). oQuery:getRecordCount = true . : : oQuery:eek:penQuery(). : : oQuery: BUFFER-HANDLE : write-json ( 'stream' , "Webstream" ). As you can see, it is a very small demo, but you can figure out how much you could to with this small code. To be able to send correct json, you will need build a correct json where you could add fields needed for sorting, curentrecord, RecordTotal etc. But that is easy This will give you all records in the filter scope and only custnum and name… The Jukebox stuff is just a kind of toolbox we uses, and you can of course do this with temp-tables etc. The cool thing with jukebox, is that you don’t have to have a db connected to the webspeed broker, since we can connect do a appserver on another machine … blablabla Enough said point made

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