WebDB Controls Data Binding (JSON/REST)


after the live demostration in Ulm yesterday, i wanted to evaluate WebCore by myself, but im stuck on an error the whole day...

I've created a webcore app. On the main form i put a TWebClientConnection, a TWebClientDatasource and -dataset. 

With object inspector i assiged "https://api.scryfall.com/sets" (without quotes o'course), and also assigned "data" to the data node property. 

Also with object inspector i referenced the connection in dataset, and the datasource in dataset, and i switched the dataset and the connection to "active".

Now right click on datasource -> retrieve fields (i'm using then german version which says 'hole felder') -> the success message appears as expected, showing the fields from the "data" node of the returning JSON object (whis is, as postulated in webcore documentions, a JSON array node).

So far so good...

but with every webdb control, e.g. the TWebDBTableCOntrol, with the datasource, datafield and datatype property properly set (i get the field names displayed in the dropdown for the only one column there, i've added), after compling and running i only get the error:

No fields found | $class::[object Object] fMessage::No fields found fHelpContext::0 
at http://localhost:8000/MagicPro/MagicPro.js [281:11]

I also get the same error when a navigation control is bound to the datasource, whis rendering is then malformed and the even error as above.

I also couldn't found any sample on the TMS website or in the installation folder regarding WebCore. So question is also, where to find working samples... 

Best Regards
Markus Kollmann, Locher & Christ GmbH

So, in field editor i've had to add the fields also (e.g. add all fields)

I've done this in the first place, but maybe due to an empirical trial and error evaluation of the components i ran into some inconsistency within the framework? Wen i can repoduce this, ill open a ticket... 

I also got sometimes "abstract" errors when removing the component from the form in designer.


I'd suggest to have a look at the demo Basics/DataSet in the demos folder. In this demo, you can see that in code the DB fields are added. In v1.0 this was still necessary. In v1.1 (the upcoming version we are working on right now ) that I demonstrated in Ulm, adding this programmatically is no longer necessary, it will be done automatically.