The Update Edit Field Demo is a great way to learn how to use data with Live Bindings. This cross-platform application makes it easy to bind the contents of an edit field with a label, using a single code base and single UI for Android, iOS, macOS, Windows, and Linux. It features change tracking so that on each key press the in-memory data set is updated with the change. With this demo, you’ll be able to quickly and easily update your labels with new data, keeping your user interface consistent across all platforms.
Download the full cross-platform change tracking data bindings source code on Github.
This demo is part of over 100 cross-platform demos with everything from camera demos to emoji demos and painting demos.
Inhaltsverzeichnis
What is change tracking for data bindings in software development?
Change tracking is a process in software development whereby changes to data bindings are tracked. This enables developers to identify which parts of their codebase need to be updated when a change is made, and also allows for rollbacks if necessary. Change tracking can be done manually or using automation tools. In either case, it is an essential part of keeping a codebase maintainable and up-to-date. Without change tracking, it would be very difficult to manage any but the simplest of software projects.
Screenshot
What does the data binding source code look like for the edit field demo?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.Klassen, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, FireDAC.DApt.Intf, System.Rtti, System.Bindings.Outputs, Fmx.Bind.Editors, Data.Bind.EngExt, Fmx.Bind.DBEngExt, Data.Bind.Komponenten, Data.Bind.DBScope, FMX.Edit, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, FMX.StdCtrls, FMX.Effects, FMX.Controls.Presentation, FireDAC.Stan.StorageBin; type TForm1 = Klasse(TForm) MaterialOxfordBlueSB: TStyleBook; ToolBar1: TToolBar; ShadowEffect4: TShadowEffect; Label1: TLabel; FDMemTable1: TFDMemTable; Edit1: TEdit; Label2: TLabel; <strong> BindSourceDB1: TBindSourceDB; BindingsList1: TBindingsList; LinkControlToField1: TLinkControlToField; LinkPropertyToFieldText: TLinkPropertyToField; procedure Edit1ChangeTracking(Sender: TObject);</strong> private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} <strong>procedure TForm1.Edit1ChangeTracking(Sender: TObject); Start TLinkObservers.ControlChanged(Edit1); end;</strong> end. |
What does the data bindings look like?
Ready to learn how to program cross-platform apps like this?
Sign up for the Coding Boot Camp 2022 to learn to program. Topics include: Games, JavaScript, Web, Python, SQL, Databases, iOS, MacOS, Android, Mobile, Linux, Windows, Desktop, Server, and Arduino.