I have written many apps in Oxygene for .NET/WPF and these apps have used Data Abstract for data access and bindings. I find the .NET binding logic easy to understand. I do a DALINQ query to return an array/list, and then I can simply set my grid’s ItemSource property to this list or array. The underlying XAML gives the field names for which to bind, and more.
I am now trying to write my first MacOS app in Oxygene, again using Data Abstract. I have a few questions about binding that are confusing me.
First, when I go through the DA wizard to create a macOS client, I end up with the expected table definitions file, but also a dataacccess.pas unit which to me seems like overkill. First question - what is the purpose of the DataAccess.pas unit? I’m not using the briefcase features, and why would I load data from all tables???
I’ve since removed that unit, made my server connection via code, and I’ve been able to do a simple query without any problem, and getting an array of results returned.
NOw…on to binding.
in my XIB file that elements created, I have a ‘File’s Owner’,‘First Responder’ and ‘Application’ objects listed at the top. I’ve been reading through some cocoa binding tutorials, and they all tell me I have to bind an array controller to the ‘Application Delegate’ object…which I don’t have.
So, here is what i’m trying to accomplish as a first task.
1 - do a DA query to get an array of results back
2 - place a TableView on my main window, and bind the results to this showing the fields of my choice
What is the simplest, or best, way to do this in elements?
For the record, i’m using Fire to write this app, with the official 9.3 version of Elements.