|Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread
|Messages 1 to 3 of 3 total
|Data controls not showing data at runtime when using datamodule
|Thu, Feb 4 2021 5:57 AM
I've migrated some EWB2 Apps to EWB3 with few modifications which use datamodules and they display the data correctly, but started a new EWB3 App and cant work out what i'm missing.
Its a simple App which has a grid to display data from a dataset. If I drag a dataset to the main form I can display the contents of the dataset in the grid.
If I use a datamodule by dragging the database to the project to create unit2 and relink the grid controls I can see the data being returned in the browser developer tools but the data does not display in any databound control. Also if I add a button to show the dataset row count it returns the correct number of rows.
I have deleted and recreated the grid which populates the columns when I connect to the dataset but still no data displayed at runtime.
|Thu, Feb 11 2021 10:49 AM
Tim Young [Elevate Software]
Elevate Software, Inc.
<< I've migrated some EWB2 Apps to EWB3 with few modifications which use datamodules and they display the data correctly, but started a new EWB3 App and cant work out what i'm missing. >>
Please send me an example of what you're doing (or you can post it here if you don't mind), and I'll take a look.
Usually this type of problem is caused by the creation order for auto-created forms/databases during application startup. The database is created after the form, so the form is left with no choice but to clear out the DataSet property for the bound control because it can't resolve/fixup the TDataSet reference when the form is created.
|Thu, Feb 11 2021 1:38 PM
If I follow the steps below I cannot get databound controls on the main form to populate with live data at runtime.
new project TForm
drag database to tab area to create Tdatabase (unit2)
drag internal server to unit2
link unit2.serversession to internalsession
add grid to form1
select dataset (which populates column names)
add button to form
button1click = Database2.LoadRows(Database2.table1);
form1.onshow = Database2.InternalSession.Authenticate; Database2.DatabaseName:='database1';
Build and Deploy project and then via https://localhost/mytestproject.html
On run and clicking Button1 I can see the authentication and data being return in the developer tools but no data in the Grid, only the fieldnames
I'm sure it is something simple I am missing, if someone could please advise
I have also noticed on several occasions the the EWB IDE seems to remember objects from previous projects, for example if I follow the above process creating a new project the second time using a different database the dataset option of the grid remember all the old datasets from the closed project where as if I close the IDE between projects it only displays the datasets of the current database.