Value List

Overview

A value list is an object from the datalayer that is used in the UI to provide selection lists and translations of internal values to display values. Value lists can be static, meaning their contents do not change, or dynamic, where they can be updated or modified over time. They can be used for example in dropdown menus, radio button groups and checkbox lists.

Property Summary

Properties Details

addEmptyValue

Property that tells if an empty value must be shown next to the items in the value list.

Type Number

Sample

can be checked or unchecked

comment

Additional information, such as programmer notes about the value list's purpose.

Type String

Sample

"list of company names from customers table"

customValues

A string with the elements in the valuelist. The elements can be separated by linefeeds (custom1 custom2), optional with realvalues ((custom1|1 custom2|2)).

Type String

Sample

Yes|1
No|2
Don't know|3

dataProviderID1

This is the dataprovider selected in the first list of dataproviders when a table or related valuelist is selected. This dataprovide can be marked as a display and/or return value.

Type String Returns a String

Sample

"companyname"

dataProviderID2

This is the dataprovider selected in the second list of dataproviders when a table or related valuelist is selected. This dataprovide can be marked as a display and/or return value.

Type String Returns a String

Sample

"customerid"

dataProviderID3

This is the dataprovider selected in the last list of dataproviders when a table or related valuelist is selected. This dataprovide can be marked as a display and/or return value.

Type String Returns a String

Sample

"contactname"

dataSource

Compact representation of the names of the server and table that are used for loading the data from the database.

Type String

Sample

"example_data.customers"

deprecated

Gets the deprecate info for this element

Type String the deprecate info for this element or null if it is not deprecated

Sample

"not used anymore, replaced by 'companynames' valuelist"

displayValueType

The type of the display value if this is a global or custom valuelist, servoy needs to know this for formatting purposes.

Type Number

Sample

"TEXT"

encapsulation

The encapsulation mode of this Valuelist. The following can be used:

  • Public (available in both scripting and designer from any module)

  • Module Scope - available in both scripting and designer but only in the same module.

Type Number the encapsulation mode/level of the persist.

Sample

"Public"

fallbackValueList

If the valuelist only displays the "active" values that a user can choose, but you still need to be able to show also old values, then a fallback valuelist should be set. So that there is a backup list for getting a display value for a real value that is not in the normal valuelist anymore.

Type Number the valueback valuelist id.

Sample

"customers_and_company_name"

globalMethod

Type String the method name

Sample

"getDataSetForValueList(displayValue, realValue, record, valueListName, findMode, rawDisplayValue)"

lazyLoading

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.

Type Boolean

Sample

can be checked or unchecked

name

The name of the value list.

It is relevant when the "useTableFilter" property is set.

Type String

Sample

"companyname"

realValueType

The type of the real value if this is a global or custom valuelist, servoy needs to know this so it can check if the types match on the record it is binded to.

Type Number

Sample

"TEXT"

relationName

The name of the relation that is used for loading data from the database.

Type String

Sample

"orders_to_order_details"

returnDataProviders

Which of the dataprovers should be used as the return dataprovider, so set back into the records dataprovider.

Type Number Returns a int

Sample

can be checked or unchecked

separator

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.

Type String

Sample

" / "

showDataProviders

Gets the showDataProvider.

Type Number Returns a int

Sample

can be checked or unchecked

sortOptions

Sort options that are applied when the valuelist loads its data from the database.

Type String

Sample

"companyname asc"

useTableFilter

Flag that tells if the name of the valuelist should be applied as a filter on the 'valuelist_name' column when retrieving the data from the database.

Type Boolean

Sample

can be checked or unchecked

valueListType

The type of the valuelist. Can be either custom values, global method, table values or related values.

Type Number

Sample

only one of them can be checked and set up accordingly

Last updated