Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 10 of 15 total |
use local storage temporary |
Mon, Jan 13 2014 10:25 AM | Permanent Link |
Mike | Hi,
How can values which are filled out in editable fields be stored (save) in local storage (without using a database) and the values loaded in fields of another screen? Is this possible? I checked the datasetclient example but can’t figure it out. The dataset is already created and columns are defined. |
Mon, Jan 13 2014 12:15 PM | Permanent Link |
Matthew Jones | You can use browser storage for some things:
szLocalGUID := Window.LocalStorage.GetItem('my_guid'); The data can be quite large, but is uninitialised so you have to watch for that too. If you are just storing data for a "global" variable to use in another form of the same application then you can just use a normal pascal global variable. /Matthew Jones/ |
Mon, Jan 13 2014 1:16 PM | Permanent Link |
Mike | Thank you for the response.
Is it not possible to save the fields to a dataset (defined at design time) via LocalStorage.Set(dsDocuments.DataSetName, dsDocuments.GetRows); and load them via dsDocuments.LoadRows(LocalStorage.Items[dsDocuments.DataSetName]); ? I would like to use to add these values to a grid on another form. |
Mon, Jan 13 2014 3:27 PM | Permanent Link |
Matthew Jones | <Mike> wrote:
> Thank you for the response. > > Is it not possible to save the fields to a dataset (defined at design time) via > > LocalStorage.Set(dsDocuments.DataSetName, dsDocuments.GetRows); > > and load them via > > dsDocuments.LoadRows(LocalStorage.Items[dsDocuments.DataSetName]); > ? > > I would like to use to add these values to a grid on another form. First, you can probably get the JSON for the database that the grid has behind it. Second, if it is another form, then you can just pass it in a variable to a property getter/setter of the form. The localstorage is only for when you want the data to still be there next week when they load your application. -- Matthew Jones |
Mon, Jan 13 2014 3:49 PM | Permanent Link |
Mike | The grid on the other form is using the dataset. The dataset is never connected to a database.
Is it always necessary to connect to a database when using a dataset? When I use the following code: szLocalGUID := Window.LocalStorage.GetItem('my_guid'); the message "[Error] Unit1.wbs (29,3): The referenced variable, parameter, or function Window does not exist" appears. |
Mon, Jan 13 2014 5:30 PM | Permanent Link |
Walter Matte Tactical Business Corporation | Do you have the HTML 5 flag turned on? Just a guess... Walter |
Mon, Jan 13 2014 5:40 PM | Permanent Link |
Mike | Yes the HTML 5 flag is turned on.
|
Mon, Jan 13 2014 8:17 PM | Permanent Link |
Raul Team Elevate | On 1/13/2014 3:49 PM, Mike wrote:
> Is it always necessary to connect to a database when using a dataset? No - you can load it from JSON direct. You still need to generate the initial json string though representing initial data. See here for JSON specs and some samples : http://www.elevatesoft.com/manual?action=viewtopic&id=ewb1&topic=JSON_Reference > When I use the following code: > szLocalGUID := Window.LocalStorage.GetItem('my_guid'); > the message "[Error] Unit1.wbs (29,3): The referenced variable, parameter, or function Window does not exist" appears. You need to add WebDom to the uses clause. Raul |
Tue, Jan 14 2014 5:30 AM | Permanent Link |
Chris Holland SEC Solutions Ltd. Team Elevate | try including the WebDom unit in the uses clauses.
Chris Holland [Team Elevate] On 13/01/2014 20:49, Mike wrote: > The grid on the other form is using the dataset. The dataset is never connected to a database. > > Is it always necessary to connect to a database when using a dataset? > > When I use the following code: > > szLocalGUID := Window.LocalStorage.GetItem('my_guid'); > > the message "[Error] Unit1.wbs (29,3): The referenced variable, parameter, or function Window does not exist" appears. > |
Tue, Jan 14 2014 5:45 AM | Permanent Link |
Matthew Jones | > No - you can load it from JSON direct. You still need to generate
> the initial json string though representing initial data. To be clear, you can start with very little JSON to start with nothing. Tim gave this example: MyDataSet.LoadRows('{ rows: [] }'); With that done, you can then manually (in code) add data to the dataset, and it will appear appropriately on the grid display. /Matthew Jones/ |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Friday, November 1, 2024 at 07:01 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |