The first contact between TMS Web core and KBMMW

Source: Internet
Author: User

Recently, TMS, after more than 1 years, assembled dozens of experts Daniel, developed a cross-era product, is the TMS Web core.

Details of the introduction, see the official website, https://www.tmssoftware.com/site/tmswebcore.asp.

This product can compile the Pascal code into JS code for the browser to recognize. Different from the previous use of JS mapping Delphi code.

This is a true compilation, that is, the compiled JS code, can be run in any Web server, and Delphi does not have any relationship.

This compiler was developed by the key developers of the famous FPC.

Of course, many people can say that now the development of the Web language so much, php,jsp,c# and so on, why do we have to use Delphi development?

The author has only three words: I like it.

Well, gossip less, we do a simple example of displaying a background database, of course, the application server we still choose KBMMW.

Don't ask me why, or three words: I like.

The server side is actually the example we used to make, which is KBMMW smart rest service.

Because you want to access data from different domains in your browser, the above example deals with cross-domain issues. This question has actually been written before.

Server-side processing of cross-domain is possible.

proceduretkbmmwcustomsmartservice3.kbmmwcustomhttpsmartservicecors (sender:tobject;ConstArequesthelper, Aresponsehelper:tkbmmwhttptransportstreamhelper;ConstAorigin:string; varAallowedorigins, Aallowedmethods, Aallowedheaders:string);beginAallowedmethods:='GET' ; Aallowedorigins:='*';//for demonstration purposes, access to any source is permitted hereaallowedheaders:='X-requested-with';End;functionTkbmmwcustomsmartservice3.getall:tobjectlist<tanimalsnoimage>;beginprocesscorsrequest; //This sentence must be added hereResult:=form1.xalionorm.querylist<tanimalsnoimage>;End;

OK, the server is finished, compile and run.

Now we do the TMS Web core side.

Create a new TMS Web application.

Put the above controls, property settings, and others that are very similar to the controls that access data in VCL.

You can right-click to add the corresponding field on the WebClientDataSet1.

All right. Add the code for the connection, just two lines of code.

procedure Tform1.webbutton1click (sender:tobject); begin    webclientconnection1.active:=True;   WEBMEMO1.LINES.ADD ('open connection! ' ); End;

Click the Delphi Run button and the project will soon compile and open the browser. Really very fast, there is a feeling of the year D7, in fact, this is normal, because he is the FPC do compiler.

Browser display

When you click Open Database, the data is displayed.

Very simple.

Introduced here today, because the TMS web core has just come out of the new version, there are a lot of problems, the biggest problem actually does not support Chinese.

has been to the official newspaper bug, hope to repair as soon as possible, otherwise can only say hehe.

The official TMS Web core project than do Mille Miglia (Trinidad Endurance), the first version followed by Brescia. It's a race for miles.

The first departure city means a long way to go. China has an old saying, called a new one. The TMS Web core is a good idea, but requires

It is a long way to go, and it is expected that multiple versions of the iteration will become a real tool for developing the web.

The first contact between TMS Web core and KBMMW

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.