|Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread|
|Messages 21 to 24 of 24 total|
|How do I parse JSON from the server?|
|Fri, May 1 2015 8:37 AM||Permanent Link|
"Tim Young [Elevate Software]" wrote:
>> It works like this:
Tim. Seriously. Never received this quality of support anywhere else. Ever. Period.
Respect and thanks. I am now on it.
|Fri, May 1 2015 9:26 AM||Permanent Link|
The support is superb, I agree.
What I'd like to see from this is a simple sample of an EWB class, some
JSON, and the implementation that loads and saves it. Something that
can then be adopted as the template by others who want to serialise in
this way. I realise that's a big ask though.
|Sat, May 2 2015 8:21 AM||Permanent Link|
Tim Young [Elevate Software]
Elevate Software, Inc.
<< What I'd like to see from this is a simple sample of an EWB class, some
JSON, and the implementation that loads and saves it. Something that can
then be adopted as the template by others who want to serialise in this way.
I realise that's a big ask though. >>
I put up an example project (it will be included with the release), that
shows how to do the save/load:
Just modify the property values (without breaking the JSON, please , and
then click on the Load Properties from Control button. Then you can click
on the Copy buttons to test moving the property values back and forth. Use
the Reset button to start over again.
The code is pretty basic:
TCustomer = class(TPersistent)
property CustomerID: String read FCustomerID write FCustomerID;
property CompanyName: String read FCompanyName write FCompanyName;
property Address1: String read FAddress1 write FAddress1;
property Address2: String read FAddress2 write FAddress2;
property City: String read FCity write FCity;
property StateProvince: String read FStateProvince write
property ZipPostalCode: String read FZipPostalCode write
property Country: String read FCountry write FCountry;
property Terms: String read FTerms write FTerms;
property Notes: String read FNotes write FNotes;
property Contact: String read FContact write FContact;
property ContactEmail: String read FContactEmail write
property ContactPhone: String read FContactPhone write
Reader.Initialize(Cust1Props); // Cust1Props is a constant with the
initial JSON values
Reader.Initialize(Cust2Props); // Cust2Props is a constant with the
initial JSON values
procedure TMainForm.MainFormCreate(Sender: TObject);
procedure TMainForm.MainFormDestroy(Sender: TObject);
procedure TMainForm.LoadCustomer1ButtonClick(Sender: TObject);
procedure TMainForm.LoadCustomer2ButtonClick(Sender: TObject);
procedure TMainForm.Copy1To2ButtonClick(Sender: TObject);
procedure TMainForm.Copy2To1ButtonClick(Sender: TObject);
procedure TMainForm.ResetButtonClick(Sender: TObject);
|Tue, May 5 2015 4:17 AM||Permanent Link|
Tim Young [Elevate Software] wrote:
> I put up an example project (it will be included with the release),
> that shows how to do the save/load:
I look forward to studying it in detail.
|« Previous Page||Page 3 of 3|
|Jump to Page: 1 2 3|
This web page was last updated on
Wednesday, March 29, 2023 at 10:59 PM
© 2023 Elevate Software, Inc. All Rights Reserved
Questions or comments ? E-mail us at email@example.com