Jump to content


  • Content Count

  • Joined

  • Last visited

About AndreM

  • Rank

Profile Information

  • Gender
    Not Telling
  1. AndreM

    Websocket server

    What is the actual error message? So with the %s filled in. For now I think there are 2 reasons: port 8099 is already in use or you miss the nodejs modules
  2. SMS is perfect capable for a business app, but it is less fancy to show it but moreover it is not easy to create a business demo (what kind of demo, what should it do?) I made 2 blog post a long time ago, maybe you can look at these to get you started: http://andremussche.blogspot.nl/2012/06/remobjects-integration-in-smart-mobile.html http://andremussche.blogspot.nl/2012/06/remobjects-integration-in-smart-mobile_21.html In short, SMS can generate client side classes for RemObjects services, the same as it is done by Remobjects itself in the Delphi IDE. So it is 100% RO code , so you can use it the same way as you did in Delphi (but some things work a little different in javascript) About data abstract: RO does not provide a (good) generator for DA tables and schemas, but you can use the plain javascript code in an ASM section in SMS. By using variants you can access the tables and colums by name, but you don't have the type safety and code completion as you have with the fully generated RemObjects code (that's the way I did not like DA). And example of an ASM section in a blog post of RO themselves (btw, with RO, not DA, before I made the generator) http://blogs.remobjects.com/blogs/valeriyg/2012/05/30/p4377 So with SMS you can use the same functions and functionality of both RO and DA, with no need to change your server side! It is just another client . About the GUI: you can use the default controls and designer of the SMS IDE, but you can also use jQuery and plain html with a html5 component set like KendoUI.
  3. AndreM

    TW3HttpRequest issue

    you need to set the AResponse.ContentType to html or something like that, otherwise the browser will only download the file as text Somethink like this: Info.ContentType := 'text/html'; Info.CharSet := 'UTF-8';
  4. AndreM

    Datasnap connector tip

    sorry, you need to replace this dll with the one besides sms.exe, it has nothing to do with isapi or whatever, it is an dll used by the sms ide
  5. AndreM

    Datasnap connector tip

    It didn't work for me at first too, but after a rebuild (with xe3 instead xe2) it seems to work: https://github.com/andremussche/AndrewsDelphiStuff/blob/master/Smart/datasnap/DataSnapProxyGenerator.dll So maybe you can try this dll?
  6. AndreM

    Datasnap connector tip

    I created a default http datasnap server in XE3, with port 12345. I started this application (!) and then runned the SMS datasnap wizard with the url "http://localhost:12345/". If this does not work for you, which error message do you get?
  7. AndreM

    JavaScript translation

    Quick and dirty from my head: uses jQuery.Core; var grid: variant := jQuery.Core.JQuery('#jqxGrid'); var options: variant := new JObject; options.source := 'your source'; var columns: array of variant := []; var column: variant := new JObject; column.text := 'Ship Name'; column.datafield := 'ShipName'; column.width := 250; columns.push(column); options.columns := variant(columns); options.groupable := true; var groups: array of string := ['ShipCity']; options.groups := variant(groups); grid.jqxGrid(options); Better is of course to make normal pascal classes (TColumn etc) instead of varaints JQuery wrapper can be downloaded here: https://github.com/andremussche/AndrewsDelphiStuff/blob/master/Smart/htmltest/jquery.Core.pas
  8. AndreM


    yes, there is already some low level support for rtti, but no higher level "easy to use" functions yet. The following should work already: procedure PrintPropertiesForType(obj : TObject); begin var rtti := RTTIRawAttributes; var aClass := obj.ClassType; PrintLn(aClass.ClassName+':'); while Assigned(aClass) do begin var typeID := TypeOf(aClass); var j : Integer; for j:=Low(rtti) to High(rtti) do begin var attrib := rtti[j]; asm console.dir(attrib); end; if (attrib.T = TypeID) and (attrib.A is RTTIPropertyAttribute) then begin var prop := RTTIPropertyAttribute(attrib.A); Print('- '+prop.Name); Print(', '+IntToStr(prop.Capabilities)); Print(' : '); Print(prop.Typ.Name); Print(' = '); var v := prop.Getter(obj); PrintLn(v); prop.Setter(obj, v+v); end; end; aClass:=aClass.ClassParent; end; end; procedure TForm1.W3Button1Click(Sender: TObject); begin PrintPropertiesForType(self); end; And attributes are supported too: type MyAttrib = class (TCustomAttribute); type [MyAttrib] TTest1 = class end; type [TCustomAttribute] TTest2 = class end; procedure PrintAttributesForType(typeID : TRTTITypeInfo); begin var rtti := RTTIRawAttributes; var j : Integer; for j:=Low(rtti) to High(rtti) do if rtti[j].T = typeID then PrintLn(rtti[j].A.ClassName); end; PrintAttributesForType(TypeOf(TTest1)); PrintAttributesForType(TypeOf(TTest2));
  9. AndreM

    Smart with Ratchet

    Nice! Can you show us some code about how you did the binding between Smart and html/ratchet?
  10. AndreM

    Delphi backend server & SMS

    node.js is indeed not a silver bullet, and also not suitable for every situation. Normal delphi server with socket.io (https://github.com/andremussche/DelphiWebsockets) or mormot or remobjects or datasnap is more suitable for business services, but node.js is very good for more website-like situations! And it is easy to deploy in the cloud (ms azure, or even for free at heroku.com) because you only have javascript text files to update. Callback "hell" (I don't like "hell", it is not that bad literally ) can be more manageable by using fibers: https://www.npmjs.org/package/fibers https://github.com/0ctave/node-sync
  11. AndreM

    Using external UI controls

    Yes, SMS has some basic controls, but as said before: there are a lot other cool UI framework available! So learning some basic html and jquery is not bad anyway Yes, the personal demos I send you could/should be included somehow in the installer.
  12. AndreM

    Using external UI controls

    Did a quick look at your demo link (http://demos.dojotoolkit.org/demos/mobileScrollableView/demo.html). When you download this link directly (not after being loaded in the browser because the DOM is changed on the fly!) for example using the network tab in Google Chrome (f12, debug mode, f5 to reload and view all files): there is no code at all in this demo, only plain html . So you can copy-paste the raw/original content/html in the Smart IDE html template, and putting the linker tags in the html <head> section: <title><?pas=Project.Title?></title> <%stylecode%> <?pas for var s in Compiler.Resources("text/css") do PrintLn('<link rel="stylesheet" href="'+s+'">'); for var s in Compiler.Resources("text/javascript") do PrintLn('<script src="'+s+'" type="text/javascript"></script>'); for var s in Compiler.AppleTouchIcons do PrintLn('<script src="'+s+'" type="text/javascript"></script>'); ?> <script type="text/javascript"> document.ontouchmove = function(e) { e.preventDefault(); } function bootstrap() { %appcode% } window.onload = function () { bootstrap(); } </script>
  13. AndreM

    Using external UI controls

    I have uploaded 2 demos: JQuery Mobile (and JQuery itself) https://github.com/andremussche/AndrewsDelphiStuff/tree/master/Smart/htmltest Ractive data binding https://github.com/andremussche/AndrewsDelphiStuff/tree/master/Smart/ractivetest Maybe I can try to make a demo of your example link (maybe next week) but at least you can already look and play with these demos. Note: no visual designer is used, but GUI components are set up in html, code is done with smart (this is the simplest way to get is working, no custom smart controls etc, but pure JQueryMobile/html)
  14. AndreM

    Using external UI controls

    Sencha is expensive and very strict, steep learning curve, etc. And personally I find extjs (on which it is based on) being outdated. There are plenty other extended (and free!) GUI controls, like: http://dhtmlx.com/ http://wijmo.com/demos/ https://demos.shieldui.com/web http://demos.telerik.com/kendo-ui/web/overview/index.html http://webix.com/demos/ http://demos.dojotoolkit.org/demos/
  15. AndreM

    Using external UI controls

    Forget sencha (altough extjs itself could work), but yes, you can use external controls in SMS (but not in the designer). There are several ways to do it, for example put the controls by hand in the html template and using jquery/getelementbyid. Or more "smart" by making a custom control with innerHtml: http://smartmobilestudio.com/documentation/creating-your-own-controls/ (although I haven't done this myself, I know I have seen a demo or something somewhere...)