sorry for the duplicate post..
I have a demo of firepower. I am attracted for the DataAware aspects. I have a fire monkey app, dropped a grid on the form, with BindSourceDB, which is attached to a query (Unidac).. If inside the IDE, I switch the active property of the query to true, I see data on my grid, no problem.. But if I run my app, run the query, I see nothing on my grid. I have confirmed that there is data in my dataset, Tried refreshing my grid.. Nothing.. Im sure Im doing something dumb..
Have you confirmed that the query is open? Has the SQL in the query changed at run-time? Are you seeing column titles in the datagrid?
Yes, after the open, I check EOF and look at the recordcount.. Im just plain confused by this..
Yes, I see the title names.. I chose the fields that I want in my grid, and changed the column headings
I would be tempted to leave the datagrid as it is, but add another one that points to the same datasource to see if that one shows records. (the configuration of the datagrid will not be the same but the idea is just to see if it shows any records.
If it does, then I'd examine the FMX file and make a text copy of the original datagrid and use that information to configure the new datagrid. You could paste into the FMX file but that might just replicate the problem. If it does, then you could delete that datagrid and add another fresh one, and this time just add the parameter changes to configure it to match the first one.
If the 2nd datagrid works, you could just move it in to replace the original but I'd also try to look at the FMX file to see how the parameters are different from the text I had saved from the first one.
Good idea, just tried that .. 2 grids side by side, one that is fresh.. Still nothing.. Going to copy dataset to memtable, see what happens.
Ok, copied the dataset to a memtable with Field defs.. still nothing.. Im about to give up.. Not sure what else to try.
I guess you don't have the option of trying FireDAC but you've already tried with a memtable. If the DB is MS SQL Server I suppose you could try dbGo (ADO) just for a test. I suppose if it were me, I'd be doing this testing in a stand-alone/single-purpose app to speed up testing. Having such an app might make it easier for Roy to replicate your tests.
Sorry, but not sure what your problem is. What version of FirePower are you using? It should not be that difficult. Could you email us one of your projects that is not working? Also what database type are you using? SQLite, etc.
Im using Sydney.. Im testing my firemonkey app in windows. The whole thing is so weird.. There must be something basic Im missing.. I will try to build a very basic shell to test.. see what happens.
OK, I got it to work.. If I put the source and query in DataModule.. It wont work .. If I put them on the same form as the grid, it works as it should. I am not at all strong in live bindings..but I suspect that its something there.. It just cant bind if its not on the same form? I would hate to think that I have to put my db components on my working forms. My whole reason for wanting these compoents is to NOT have to learn live bindings.. They seem like a lot of work for simple things. I have never gotten the hang of them. Hence your components.
Someone said on a forum.."
u must have the Datamodule Unitname in your interface / uses section at the begin of your form
unit. If u declare it in the implementation / unit section, it doesnt work right with livebindings."
Could that be it?
Nope, that didnt help.. I dont know.. If its on the same form, works fine, otherwise, nothing seems to be bound at runtime.
As far as data modules, open them before your form loads. Look at your auto-created forms, and make sure your data module is created before your forms.
Yup, did that.. its the first thing created. before all other forms..
You still have not told me the questions I asked.
What version of FirePower are you using? It should not be that difficult. Could you email us one of your projects that is not working? Also what database type are you using? SQLite, etc
Not sure of your problem then without looking at a project. You could try using your form's OnShow event and calling the method RefreshGrid to see if that helps..
I just downloaded firepower a day or so ago.. Syndey version.. Im using SDAC, connecting to SQL server. I can put the project together and send it to you.. let me see if I can make a simple shell that fails.
fyi - our maindemo uses a data module so it does work with data modules.
Also I recommend trying to see if you can reproduce without using 3rd party back-ends that I won't be able to connect to. Try copying your unidac dataset to a TClientDatasSet at design time (Right Click TClientDataSet and select Assign Local Data). Then connect your grid to that to see if it still fails. Then I don't need to have your server to run your projct.
Yes, I tried to put a TKBMMemTable and a FDMemTable i the Datamodule..Then Loaded it from my query.. Same issue.. BUT, if I put any of these components on my Grid form, all is well. So, I dont think its a compat issue with the datasets.. None of them work on the DataModule.. ALL of them work if I move them into the grid form.. . In the IDE designtime, it works fine.. Its at runtime it fails. So weird.
The way Im getting around it now is.. I put a source and memtable on the grid form.. I load my memtable from My TMSQuery from my datamodule.. All seems fine that way.. This could work.. But just weird..
Ok, I have 2 small demos..One works, one doesnt.. Where can I send them?
You can send them to firstname.lastname@example.org
Not sure if this adds anything, but I always have my DataModules created before any forms whether the app is FMX or VCL.
And for the DataSource property of the datagrids of FMX apps, I specify a BindSource that is in the DM and there are no TDataSource in my FMX projects.
Gordon, thanks for the project.
Unfortunately your demo is using 3rd party components which I do not have, so I am not able to run your project. However in your project, your auto-created forms you have the data module in there twice so you would be creating two instances of it. You should not have two instances and this could be contributing to your problems.
Look at your list of auto-created forms and you can see what I mean.
Yup, Im an idiot.. cant believe I missed that.. Have no idea why it was in there twice..
Please sign in to leave a comment.