StringList Editor

From Lianjapedia
Jump to: navigation, search

Overview

The StringList Editor is displayed in a dialog and allows list items to be selected and deselected. From v5.3.

It can be specified as the Cell editor type for Form Section Fields, Grid Columns and Canvas Section Advanced TextBox Controls that are data-bound to varchar/memo variable length columns.

StringList Editor


It can also be called directly using the Lianja.showMoverDialog() method.

Stringlist Cell Editor Type

If the Cell editor type of a Form Section Field, Grid Column or Canvas Section Advanced TextBox Control data-bound to varchar/memo column is set to 'Stringlist', clicking on the field slides in the StringList Editor as shown above.

StringList Attribute

The StringList attribute is used to specify the list of items that can be selected. This can be a comma-separated list, a SQL Select statement or a {} macro specifying a function call to return a comma-separated string, e.g.

Specify a comma-separated list of constants:

Coffee,Tea,Beer,Soda,Water

Issue a dynamic SQL Select statement:

select productname from products

Call the pgetorders function, which must return a comma-separated string:

{pgetorders()}

or, including a macro'd argument, numeric value here:

{pgetorders({{categoryid}})}

or character value here:

{pgetorders("{{categoryname}}")}

Note the use of the double curly braces {{}}. This ensures the macro substitution of the categoryid or categoryname is carried out before the pgetorders() function is called.

Lianja.showMoverDialog()

The Lianja.showMoverDialog() method displays the StringList Editor in a centered popup dialog, e.g.

Lianja.showMoverDialog("Select Items","Items Selected","Coffee,Tea,Beer,Soda,Water","Coffee,Tea")
result = Lianja.getDialogResult()

StringList Editor

The Lianja.showMoverDialog() method is available on the desktop in Lianja/VFP or JavaScript and in JavaScript in the Web Client.

Note that in the Web Client, the dialog panel slides in from the right and the method can only be used to update a target element and not to get the selected items.

Syntax

Lianja.showMoverDialog(cTitle, cCaption, cItems, cSelecteditems [, cTargetid])
Arg Description
cTitle The title displayed in the dialog header.
cCaption The text displayed above the selected items (right hand list)
cItems The list of selectable items. This can be a comma-separated string, a string containing a SQL Select statement or a {} macro specifying a function call to return a comma-separated string. See examples above.
cSelecteditems The list of items already selected. This can be a comma-separated string, a string containing a SQL Select statement or a {} macro specifying a function call to return a comma-separated string. See examples above.
cTargetid The id of the target UI element, e.g. "page1.section1.field1".
In the Web Client, this must be specified.