I tried to compile a barebone REST-client I have for Web Core. The program works with an XData-server.
After succesfull compiling in Delphi the JS compiler complains:
[Error] UnClientConnectieINT.pas(38): can't find unit "XData.Client"
I use the latest versions of all components. Doesn't it work with the regular version of XData yet? Do I need the special version mentioned in the readme? I that case I'll wait a little longer until the regular version is ok to use, because I don't want to get involved with two different versions of XData.
The latest version of TMS XData should be sufficient.
Can you verify the library path passed to the pas2js compiler that it includes the folder where TMS XData is installed? You can see all command-line arguments for pas2js in the IDE console.
Now it complains about generics.collections, which is part of Delphi. But I don't see any part of Delphi in the list of directories that is supplied to pas2js. Only TMS libraries.
What you would like to use a conditional define for? What exactly did you try with $DEFINE?
With TMS Web Core, you must use a different client class, named TXDataWebClient. They are different controls, different way of use. TXDataWebClient is asynchronous, it does not have a generic version, etc., so they are quite different.
fwiw, you can use the conditional define {$IFDEF WIN32} for when you compile code for a windows target and {$IFDEF PAS2JS} for code for the web client only
I have cleaned it up and I'm using the latest version.
I have decided to put this project on hold for some time, until Web Core has matured and there is some documentation. It's promising, but not usable in a real project for now. Most of the time I am totally in the dark about what to do, when it comes to something outside the supplied examples. If I am going to use it, it has to fit into my main project somehow and that is totally not the case for now.
I get that. What I try to do is this: I have a win32 XData
clientprogram in which the userinterface and the connection with the
XData server are strictly separated. In an ideal world I would only have
to write a new user-interface in WebCore and re-use the units that
connect to XData. The Connection is made with an XDataclient. As you
suggested I introduced conditional compiling with IFDEFs to use an
XDataclient or an XDataWebClient to make the connection. The compiler did not give me errors on the clients anymore, but now I get this: [Error] XData.Web.Connection.pas(36): There is no method in an ancestor class to be overridden "procedure EndUpdate of Object" which I can't resolve. So I'm stuck. I
was hoping to move forward step by step and when things simply would
not work, I would take them out. But I can't resolve an error like this,
because I don't know what to look for.
Ronald, could you please search in your entire disk for file named Classes.pas?
There should be the ones from Delphi, but also from TMS Web Core. Could you please then send me the Classes.pas file you found in the e-mail, mentioning the folders you found them? Thank you very much in advance.
The Classes.pas you have for TMS Web Core is not the latest one. That's why you get compilation errors when using TMS XData. I know that you stated you have installed latest version of TMS Web Core, but something is not right. I would suggest you uninstall it, download the very latest version and install it again.