"one\ntwo\nthree\nfour";
vlist.addEmptyValue = JSValueList.EMPTY_VALUE_NEVER;
var cmb = form.newComboBox('my_table_text', 10, 10, 100, 20);
cmb.valuelist = vlist;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
customValues |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
A string with the elements in the valuelist. The elements can be separated by linefeeds (custom1 custom2), optional with realvalues ((custom1|1 custom2|2)). |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var vl1 = solutionModel.newValueList("customtext",JSValueList.CUSTOM_VALUES);
vl1.customValues = "customvalue1\ncustomvalue2";
var vl2 = solutionModel.newValueList("customid",JSValueList.CUSTOM_VALUES);
vl2.customValues = "customvalue1|1\ncustomvalue2|2";
var form = solutionModel.newForm("customvaluelistform",controller.getDataSource(),null,true,300,300);
var combo1 = form.newComboBox("globals.text",10,10,120,20);
combo1.valuelist = vl1;
var combo2 = form.newComboBox("globals.id",10,60,120,20);
combo2.valuelist = vl2;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
dataSource |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Compact representation of the names of the server and table that are used for loading the data from the database. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var vlist = solutionModel.newValueList('options', JSValueList.DATABASE_VALUES);
vlist.dataSource = 'db:/example_data/parent_table';
vlist.setDisplayDataProviderIds('parent_table_text');
vlist.setReturnDataProviderIds('parent_table_text');
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
globalMethod |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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()) |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var listProvider = solutionModel.newGlobalMethod('function getDataSetForValueList(displayValue, realValue, record, valueListName, findMode) {' +
' ' +
'if (displayValue == null && realValue == null) {' +
' // TODO think about caching this result. can be called often!' +
' // return the complete list' +
' return databaseManager.getDataSetByQuery("example_data", "select firstname || ' ' || lastname, employeeid from employees", null, 100);' +
'} else if (displayValue != null) {' +
' // TYPE_AHEAD filter call, return a filtered list' +
' var args = [displayValue + "%", displayValue + "%"]' +
' return databaseManager.getDataSetByQuery("example_data", "select firstname || ' ' || lastname, employeeid from employees where firstname like ? or lastname like ?", args, 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];' +
' return databaseManager.getDataSetByQuery("example_data", "select firstname || ' ' || lastname, employeeid from employees where employeeid = ?", args, 1);' +
'}' +
'}');
var vlist = solutionModel.newValueList('vlist', JSValueList.CUSTOM_VALUES);
vlist.globalMethod = listProvider;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
The name of the value list. It is relevant when the "useTableFilter" property is set. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var vlist = solutionModel.newValueList('options', JSValueList.DATABASE_VALUES);
vlist.serverName = 'example_data';
vlist.tableName = 'valuelists';
vlist.setDisplayDataProviderIds('valuelist_data');
vlist.setReturnDataProviderIds('valuelist_data');
vlist.useTableFilter = true;
vlist.name = 'two';
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
relationName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
The name of the relation that is used for loading data from the database. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var rel = solutionModel.newRelation('parent_to_child', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
rel.newRelationItem('parent_table_id', '=', 'child_table_parent_id');
var vlist = solutionModel.newValueList('options', JSValueList.DATABASE_VALUES);
vlist. |
|
|
|
|
|