servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClientservoy sSummary12%30%58%height: 30px;3Constants SummaryConstant to set the valueListType of a JSValueList.Constant to set the valueListType of a JSValueList.
The global method of the valuelist is called to fill in or adjust the values of the valuelist.A property special for NGClient and GlobalValuelist to only query the global valuelist when it is needed.The name of the value list.
A String representing the separator that should be used when multiple display dataproviders are set, when the value list has the type set to database values.
var vlist = solutionModel.newValueList('options', JSValueList.CUSTOM_VALUES);
application.output(vlist.getUUID().toString());
...
class
lastDetailRow
...
id
setDisplayDataProviderIds
Table Row (tr)
id
name
Table Cell (td)
setDisplayDataProviderIds
Table Row (tr)
id
sig
Table Cell (td)
Span
style
margin-right: 5px;
void
Span
style
font-weight: bold;
setDisplayDataProviderIds
Span
()
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Set the display dataproviders. There can be at most 3 of them, combined with the return dataproviders. The values taken from these dataproviders, in order, separated by the separator, will be displayed by the valuelist.
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
void
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
var vlist = solutionModel.newValueList('options', JSValueList.CUSTOM_VALUES);
vlist.valueListType = JSValueList.DATABASE_VALUES; // Change the type to database values.
vlist.dataSource = 'db:/example_data/parent_table';
vlist.setDisplayDataProviderIds('parent_table_text');
vlist.setReturnDataProviderIds('parent_table_text', 'parent_table_id');
vlist.separator = ' ## ';
vlist.sortOptions = 'parent_table_text desc';
...
class
lastDetailRow
...
id
setDisplayDataProviderIds-String
Table Row (tr)
id
name
Table Cell (td)
setDisplayDataProviderIds
Table Row (tr)
id
sig
Table Cell (td)
Span
style
margin-right: 5px;
void
Span
style
font-weight: bold;
setDisplayDataProviderIds
Span
(dataprovider1)
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Set the display dataproviders. There can be at most 3 of them, combined with the return dataproviders. The values taken from these dataproviders, in order, separated by the separator, will be displayed by the valuelist.
Table Row (tr)
id
prs
Table Cell (td)
Parameters
Div
class
sIndent
{String} dataprovider1 - The first display dataprovider.
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
void
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
var vlist = solutionModel.newValueList('options', JSValueList.CUSTOM_VALUES);
vlist.valueListType = JSValueList.DATABASE_VALUES; // Change the type to database values.
vlist.dataSource = 'db:/example_data/parent_table';
vlist.setDisplayDataProviderIds('parent_table_text');
vlist.setReturnDataProviderIds('parent_table_text', 'parent_table_id');
vlist.separator = ' ## ';
vlist.sortOptions = 'parent_table_text desc';
...
class
lastDetailRow
...
id
setDisplayDataProviderIds-String_String
Table Row (tr)
id
name
Table Cell (td)
setDisplayDataProviderIds
Table Row (tr)
id
sig
Table Cell (td)
Span
style
margin-right: 5px;
void
Span
style
font-weight: bold;
setDisplayDataProviderIds
Span
(dataprovider1, dataprovider2)
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Set the display dataproviders. There can be at most 3 of them, combined with the return dataproviders. The values taken from these dataproviders, in order, separated by the separator, will be displayed by the valuelist.
Table Row (tr)
id
prs
Table Cell (td)
Parameters
Div
class
sIndent
{String} dataprovider1 - The first display dataprovider. {String} dataprovider2 - The second display dataprovider.
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
void
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
var vlist = solutionModel.newValueList('options', JSValueList.CUSTOM_VALUES);
vlist.valueListType = JSValueList.DATABASE_VALUES; // Change the type to database values.
vlist.dataSource = 'db:/example_data/parent_table';
vlist.setDisplayDataProviderIds('parent_table_text');
vlist.setReturnDataProviderIds('parent_table_text', 'parent_table_id');
vlist.separator = ' ## ';
vlist.sortOptions = 'parent_table_text desc';
...
class
lastDetailRow
...
id
setDisplayDataProviderIds-String_String_String
Table Row (tr)
id
name
Table Cell (td)
setDisplayDataProviderIds
Table Row (tr)
id
sig
Table Cell (td)
Span
style
margin-right: 5px;
void
Span
style
font-weight: bold;
setDisplayDataProviderIds
Span
(dataprovider1, dataprovider2, dataprovider3)
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Set the display dataproviders. There can be at most 3 of them, combined with the return dataproviders. The values taken from these dataproviders, in order, separated by the separator, will be displayed by the valuelist.
Table Row (tr)
id
prs
Table Cell (td)
Parameters
Div
class
sIndent
{String} dataprovider1 - The first display dataprovider. {String} dataprovider2 - The second display dataprovider. {String} dataprovider3 - The third display dataprovider.
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
void
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
var vlist = solutionModel.newValueList('options', JSValueList.CUSTOM_VALUES);
vlist.valueListType = JSValueList.DATABASE_VALUES; // Change the type to database values.
vlist.dataSource = 'db:/example_data/parent_table';
vlist.setDisplayDataProviderIds('parent_table_text');
vlist.setReturnDataProviderIds('parent_table_text', 'parent_table_id');
vlist.separator = ' ## ';
vlist.sortOptions = 'parent_table_text desc';
...
class
lastDetailRow
...
id
setReturnDataProviderIds
Table Row (tr)
id
name
Table Cell (td)
setReturnDataProviderIds
Table Row (tr)
id
sig
Table Cell (td)
Span
style
margin-right: 5px;
void
Span
style
font-weight: bold;
setReturnDataProviderIds
Span
()
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Set the return dataproviders. There can be at most 3 of them, combined with the display dataproviders. The values taken from these dataproviders, in order, separated by the separator, will be returned by the valuelist.
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
void
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
var vlist = solutionModel.newValueList('options', JSValueList.CUSTOM_VALUES);
vlist.valueListType = JSValueList.DATABASE_VALUES; // Change the type to database values.
vlist.dataSource = 'db:/example_data/parent_table';
vlist.setDisplayDataProviderIds('parent_table_text');
vlist.setReturnDataProviderIds('parent_table_text', 'parent_table_id');
vlist.separator = ' ## ';
vlist.sortOptions = 'parent_table_text desc';
...
class
lastDetailRow
...
id
setReturnDataProviderIds-String
Table Row (tr)
id
name
Table Cell (td)
setReturnDataProviderIds
Table Row (tr)
id
sig
Table Cell (td)
Span
style
margin-right: 5px;
void
Span
style
font-weight: bold;
setReturnDataProviderIds
Span
(dataprovider1)
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Set the return dataproviders. There can be at most 3 of them, combined with the display dataproviders. The values taken from these dataproviders, in order, separated by the separator, will be returned by the valuelist.
Table Row (tr)
id
prs
Table Cell (td)
Parameters
Div
class
sIndent
{String} dataprovider1 - The first return dataprovider.
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
void
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
var vlist = solutionModel.newValueList('options', JSValueList.CUSTOM_VALUES);
vlist.valueListType = JSValueList.DATABASE_VALUES; // Change the type to database values.
vlist.dataSource = 'db:/example_data/parent_table';
vlist.setDisplayDataProviderIds('parent_table_text');
vlist.setReturnDataProviderIds('parent_table_text', 'parent_table_id');
vlist.separator = ' ## ';
vlist.sortOptions = 'parent_table_text desc';
...
class
lastDetailRow
...
id
setReturnDataProviderIds-String_String
Table Row (tr)
id
name
Table Cell (td)
setReturnDataProviderIds
Table Row (tr)
id
sig
Table Cell (td)
Span
style
margin-right: 5px;
void
Span
style
font-weight: bold;
setReturnDataProviderIds
Span
(dataprovider1, dataprovider2)
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Set the return dataproviders. There can be at most 3 of them, combined with the display dataproviders. The values taken from these dataproviders, in order, separated by the separator, will be returned by the valuelist.
Table Row (tr)
id
prs
Table Cell (td)
Parameters
Div
class
sIndent
{String} dataprovider1 - The first return dataprovider. {String} dataprovider2 - The second return dataprovider.
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
void
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
var vlist = solutionModel.newValueList('options', JSValueList.CUSTOM_VALUES);
vlist.valueListType = JSValueList.DATABASE_VALUES; // Change the type to database values.
vlist.dataSource = 'db:/example_data/parent_table';
vlist.setDisplayDataProviderIds('parent_table_text');
vlist.setReturnDataProviderIds('parent_table_text', 'parent_table_id');
vlist.separator = ' ## ';
vlist.sortOptions = 'parent_table_text desc';
...
class
lastDetailRow
...
id
setReturnDataProviderIds-String_String_String
Table Row (tr)
id
name
Table Cell (td)
setReturnDataProviderIds
Table Row (tr)
id
sig
Table Cell (td)
Span
style
margin-right: 5px;
void
Span
style
font-weight: bold;
setReturnDataProviderIds
Span
(dataprovider1, dataprovider2, dataprovider3)
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Set the return dataproviders. There can be at most 3 of them, combined with the display dataproviders. The values taken from these dataproviders, in order, separated by the separator, will be returned by the valuelist.
Table Row (tr)
id
prs
Table Cell (td)
Parameters
Div
class
sIndent
{String} dataprovider1 - The first return dataprovider. {String} dataprovider2 - The second return dataprovider. {String} dataprovider3 - The third return dataprovider.
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
void
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
var vlist = solutionModel.newValueList('options', JSValueList.CUSTOM_VALUES);
vlist.valueListType = JSValueList.DATABASE_VALUES; // Change the type to database values.
vlist.dataSource = 'db:/example_data/parent_table';
vlist.setDisplayDataProviderIds('parent_table_text');
vlist.setReturnDataProviderIds('parent_table_text', 'parent_table_id');
vlist.separator = ' ## ';
vlist.sortOptions = 'parent_table_text desc';
...
class
lastDetailRow
...
sIndentclients
...
class
sIndent
...
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
var vlist = solutionModel.newValueList('options', JSValueList.DATABASE_VALUES);
vlist.valueListType = JSValueList.CUSTOM_VALUES; // Change the type to custom values.
vlist.customValues = "one\ntwo\nthree\nfour";
...
class
lastDetailRow
...
id
DATABASE_VALUES
Table Row (tr)
id
name
Table Cell (td)
DATABASE_VALUES
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Constant to set the valueListType of a JSValueList. Sets the value list to use values loaded from a database. Also used in solutionModel.newValueList(...) to create new valuelists
A string with the elements in the valuelist. The elements can be separated by linefeeds (custom1 custom2), optional with realvalues ((custom1|1 custom2|2)).
var myValueList = solutionModel.getValueList('myValueListHere')
//get fallback value list
var fallbackValueList = myValueList.fallbackValueList
...
class
lastDetailRow
...
id
globalMethod
Table Row (tr)
id
name
Table Cell (td)
globalMethod
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
A global method that provides the data for the valuelist. The global method must provided the data as a JSDataSet.
It is called when the valuelist needs data, it has 3 modes. real and display params both null: return the whole list only display is specified, called by a typeahead, return a filtered list only real value is specified, called when the list doesnt contain the real value for the give record value, this will insert this value into the existing list.
In find mode the record with be the FindRecord which is just like a normal JSRecord (DataRecord) it has the same properties (column/dataproviders) but doesnt have its methods (like isEditing())
var listProvider = solutionModel.newGlobalMethod('globals', 'function getDataSetForValueList(displayValue, realValue, record, valueListName, findMode) {' +
' ' +
'var args = null;' +
'/** @type QBSelect<db:/example_data/employees> */' +
'var query = databaseManager.createSelect('db:/example_data/employees');' +
'/** @type {JSDataSet} */' +
'var result = null;' +
'if (displayValue == null && realValue == null) {' +
' // TODO think about caching this result. can be called often!' +
' // return the complete list' +
' query.result.add(query.columns.firstname.concat(' ').concat(query.columns.lastname)).add(query.columns.employeeid);' +
' result = databaseManager.getDataSetByQuery(query,100);' +
'} else if (displayValue != null) {' +
' // TYPE_AHEAD filter call, return a filtered list' +
' args = [displayValue + "%", displayValue + "%"]' +
' query.result.add(query.columns.firstname.concat(' ').concat(query.columns.lastname)).add(query.columns.employeeid).' +
' root.where.add(query.or.add(query.columns.firstname.lower.like(args[0] + '%')).add(query.columns.lastname.lower.like(args[1] + '%')));' +
' result = databaseManager.getDataSetByQuery(query,100);' +
'} else if (realValue != null) {' +
' // TODO think about caching this result. can be called often!' +
' // real object not found in the current list, return 1 row with display,realvalue that will be added to the current list' +
' // dont return a complete list in this mode because that will be added to the list that is already there' +
' args = [realValue];' +
' query.result.add(query.columns.firstname.concat(' ').concat(query.columns.lastname)).add(query.columns.employeeid).' +
' root.where.add(query.columns.employeeid.eq(args[0]));' +
' result = databaseManager.getDataSetByQuery(query,1);' +
'}' +
'return result;' +
'}');
var vlist = solutionModel.newValueList('vlist', JSValueList.CUSTOM_VALUES);
vlist.globalMethod = listProvider;
...
class
lastDetailRow
...
id
name
Table Row (tr)
id
name
Table Cell (td)
name
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
The name of the value list.
It is relevant when the "useTableFilter" property is set.
Constant to set the valueListType of a JSValueList.
Sets the value list to use values loaded from a database.
Also used in solutionModel.newValueList(...) to create new valuelists
Property that tells if an empty value must be shown next to the items in the value list.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowcustomValuesname
customValues
dessIndent
A string with the elements in the valuelist. The elements
can be separated by linefeeds (custom1
custom2), optional with realvalues ((custom1|1
custom2|2)).
The global method of the valuelist is called to fill in or adjust the values of the valuelist.
The method returns a dataset with one or two columns, first column is the display value, second column is real value(if present).
The valuelist will be filled in with the dataset data. If second column is not present real value and display value will be the same.
The method has to handle three different scenarios:
1. 'displayValue' parameter is not null, this parameter should be used to filter the list of values(in a typeahead fashion)
2. 'realValue' parameter is specified, that means value was not found in current list, so must be specified manually.
In this case method should return only one row in the dataset, with the missing value, that will be added to the valuelist
3. 'realValue' and 'displayValue' are both null , in this case the complete list of values should be returned.
Scenario 1 and 3 will completely replace any older results in the valuelist while scenario 2 will append results.
In find mode the record will be the FindRecord which is just like a normal JSRecord (DataRecord) it has the same properties (column/dataproviders) but doesnt have its methods (like isEditing())
The last argument is rawDisplayValue which contains the same text as displayValue but without converting it to lowercase.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowlazyLoadingname
lazyLoading
dessIndent
A property special for NGClient and GlobalValuelist to only query the global valuelist when it is needed.
This flag has to be set both on valuelist and in component spec, on the valuelist property.
IMPORTANT: Usage of real & display values is not fully supported with lazy loading. Don't set lazy load if your method returns both real and display values
This is because very likely we do need directly the display value for the given real to dispaly its value..
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRownamename
name
dessIndent
The name of the value list.
It is relevant when the "useTableFilter" property is set.
The name of the relation that is used for loading data from the database.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowseparatorname
separator
dessIndent
A String representing the separator that should be used when multiple
display dataproviders are set, when the value list has the type set to
database values.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowserverNamename
serverName
dessIndent
The name of the database server that is used for loading the values when
the value list has the type set to database/table values.
Set the display dataproviders. There can be at most 3 of them, combined with the return dataproviders.
The values taken from these dataproviders, in order, separated by the separator, will be displayed
by the valuelist.
Set the display dataproviders. There can be at most 3 of them, combined with the return dataproviders.
The values taken from these dataproviders, in order, separated by the separator, will be displayed
by the valuelist.
prs
Parameters
sIndentdataprovider1The first display dataprovider.clients
Set the display dataproviders. There can be at most 3 of them, combined with the return dataproviders.
The values taken from these dataproviders, in order, separated by the separator, will be displayed
by the valuelist.
prs
Parameters
sIndentdataprovider1The first display dataprovider.dataprovider2The second display dataprovider.clients
Set the display dataproviders. There can be at most 3 of them, combined with the return dataproviders.
The values taken from these dataproviders, in order, separated by the separator, will be displayed
by the valuelist.
prs
Parameters
sIndentdataprovider1The first display dataprovider.dataprovider2The second display dataprovider.dataprovider3The third display dataprovider.clients
Set the return dataproviders. There can be at most 3 of them, combined with the display dataproviders.
The values taken from these dataproviders, in order, separated by the separator, will be returned
by the valuelist.
Set the return dataproviders. There can be at most 3 of them, combined with the display dataproviders.
The values taken from these dataproviders, in order, separated by the separator, will be returned
by the valuelist.
prs
Parameters
sIndentdataprovider1The first return dataprovider.clients
Set the return dataproviders. There can be at most 3 of them, combined with the display dataproviders.
The values taken from these dataproviders, in order, separated by the separator, will be returned
by the valuelist.
prs
Parameters
sIndentdataprovider1The first return dataprovider.dataprovider2The second return dataprovider.clients
Set the return dataproviders. There can be at most 3 of them, combined with the display dataproviders.
The values taken from these dataproviders, in order, separated by the separator, will be returned
by the valuelist.
prs
Parameters
sIndentdataprovider1The first return dataprovider.dataprovider2The second return dataprovider.dataprovider3The third return dataprovider.clients