WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.
-
Upload
melvyn-osborne -
Category
Documents
-
view
222 -
download
0
Transcript of WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.
![Page 1: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/1.jpg)
WaveMaker Visual AJAX Studio 4.0 Training
Basics: LiveVariables
![Page 2: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/2.jpg)
2
How it Works
● When you create a LiveVariable, you select a LiveView or LiveTable to base it on
● You must also select a database operation for the LiveVariable: Read, Insert, Update or Delete
● When you create a LiveForm or a DataGrid, you select a LiveVariable to use as the data set
![Page 3: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/3.jpg)
3
Bind Components to Data Source
● LiveVariable forms the link between the data source and the LiveForm or DataGrid
LiveForm/ DataGridLiveVariableDatabase
![Page 4: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/4.jpg)
4
Create a New LiveVariable
● On the Component Tree menu, click New LiveVariable icon
● Properties for the new LiveVariable now appear in the Property Editor
![Page 5: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/5.jpg)
5
Name the New LiveVariable
● Type in a name for the name property in the Property Editor
● This is the name that appears in the Component Tree and in the Binding dialogs so make the name descriptive
– Studio gives the LiveVariable a default name, so this step is optional, but recommended
![Page 6: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/6.jpg)
6
Choose a Data Source
● Select a data source from the drop-down menu for the liveSource property
● This list includes all the LiveTables and LiveViews defined in the project
![Page 7: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/7.jpg)
7
LiveTables or LiveViews?
● When you create a LiveVariable, you must choose a LiveTable or a LiveView as the “source” for the data
● Choose a LiveView when:– You need to access fields from a related table or
– Your LiveTable has a composite primary key
● Otherwise, use a LiveTable
![Page 8: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/8.jpg)
8
Choose a Data Operation
● Select a data operation from the drop-down menu for the operation property
● This list includes the following database operations:
– readData
– insertData
– updateData
– deleteData
![Page 9: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/9.jpg)
9
Filter the Data (optional)
● You can filter the data in the specified by the liveSource:– specify a filter object– filter individual fields
● You can only set up filters when the LiveVariable operation is readData
● Filter can be bound to a widget, expression, or service variable
![Page 10: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/10.jpg)
10
Filter the liveSource as a Whole
● Use the filter property in the Properties Tree
● Bind to an object of the same type as the LiveVariable
![Page 11: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/11.jpg)
11
Filter individual Fields
● Select a filter object in the Properties Tree
● Individual fields appear in the Property Editor
![Page 12: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/12.jpg)
12
Bind to the Field
● You can bind a filter to one or more fields
● Fields marked with an asterisk are complex structures – Bind the whole structure to an object
of the same type or– Expand the structure in the Properties
Tree and bind to individual fields
![Page 13: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/13.jpg)
13
Other LiveVariable Properties
● autoUpdate: automatically refresh data from database
● ignoreCaseChoose: whether to make the results case sensitive or not
● updateNow: update the Service Variable (use in design mode)
● queue: defines a list of Service Variables to execute, in order, after this Variable executes
![Page 14: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/14.jpg)
14
LiveVariable Properties for Lists
● firstRow: for setting up paging in conjunction with maxResults (ignored if maxResults is not set)
● maxResults: the number of records that will be returned at runtime
● designMaxResults: the number of records that will be returned when viewing data at design time.
● orderBy: specify a property to use for ordering the data (you can order in ascending or descending order)
![Page 15: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/15.jpg)
15
sourceData Property
● Use of the sourceData property is an advanced topic. It is not needed in most cases.
![Page 16: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/16.jpg)
16
Questions?
![Page 17: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables.](https://reader035.fdocuments.in/reader035/viewer/2022062322/56649e3b5503460f94b2d36e/html5/thumbnails/17.jpg)
17
Exercises 8
● Add a Live Variable– Bind to DataGrid
– Filter based on Search Criteria