wavemaker visual ajax studio 4.0 training basics: livevariables

17
WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables

Upload: melvyn-osborne

Post on 11-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables

WaveMaker Visual AJAX Studio 4.0 Training

Basics: LiveVariables

Page 2: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables

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

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

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

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

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

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

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

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

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

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

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

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

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

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

16

Questions?

Page 17: WaveMaker Visual AJAX Studio 4.0 Training Basics: LiveVariables

17

Exercises 8

● Add a Live Variable– Bind to DataGrid

– Filter based on Search Criteria