Difference between revisions of "StringList Editor"

From Lianjapedia
Jump to: navigation, search
(Created page with "''Under Construction'' Category:Lianja v5.3")
 
(Lianja.showMoverDialog())
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
''Under Construction''
+
==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 [[Field Attributes|Form Section Fields]], [[Grid Column Attributes|Grid Columns]] and [[Advanced Canvas Control Attributes|Canvas Section Advanced TextBox Controls]] that are data-bound to varchar/memo variable length columns.
 +
 +
[[{{ns:file}}:stringlisteditor1.png|800px|left|border|link={{filepath:stringlisteditor1.png}}|StringList Editor]]
 +
<br clear=all>
 +
 +
It can also be called directly using the Lianja.showMoverDialog() method.
 +
 +
==Stringlist Cell Editor Type==
 +
If the '''Cell editor type''' of a [[Field Attributes|Form Section Field]], [[Grid Column Attributes|Grid Column]] or [[Advanced Canvas Control Attributes|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 [[#Overview|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|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:
 +
 +
<pre>Coffee,Tea,Beer,Soda,Water</pre>
 +
 +
Issue a dynamic SQL Select statement:
 +
 +
<pre>select productname from products</pre>
 +
 +
Call the pgetorders function, which must return a comma-separated string:
 +
 +
<pre>{pgetorders()}</pre>
 +
 +
or, including a macro'd argument, numeric value here:
 +
 +
<pre>{pgetorders({{categoryid}})}</pre>
 +
 +
or character value here:
 +
 +
<pre>{pgetorders("{{categoryname}}")}</pre>
 +
 +
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.
 +
 +
<code lang="recital">
 +
Lianja.showMoverDialog("Select Items","Items Selected","Coffee,Tea,Beer,Soda,Water","Coffee,Tea")
 +
result = Lianja.getDialogResult()
 +
</code>
 +
 +
[[{{ns:file}}:stringlisteditor2.png|link={{filepath:stringlisteditor2.png}}|StringList Editor]]
 +
<br clear=all>
 +
 +
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===
 +
 +
<pre>Lianja.showMoverDialog(cTitle, cCaption, cItems, cSelecteditems [, cTargetid])</pre>
 +
 +
{| class="wikitable" width="100%"
 +
!width="30%"|Arg
 +
!width="70%"|Description
 +
|-
 +
|valign="top"|cTitle||The title displayed in the dialog header.
 +
|-
 +
|valign="top"|cCaption||The text displayed above the selected items (right hand list)
 +
|-
 +
|valign="top"|cItems||The list of selectable items.  This can be a comma-separated string, a string containing a [[SQL SELECT|SQL Select]] statement or a {} macro specifying a function call to return a comma-separated string.  See [[#StringList Attribute|examples above]].
 +
|-
 +
|valign="top"|cSelecteditems||The list of items already selected.  This can be a comma-separated string, a string containing a [[SQL SELECT|SQL Select]] statement or a {} macro specifying a function call to return a comma-separated string.  See [[#StringList Attribute|examples above]].
 +
|-
 +
|valign="top"|cTargetid||The id of the target UI element, e.g. "page1.section1.field1".<br> In the Web Client, this must be specified.
 +
|-
 +
|}
  
  
 
[[Category:Lianja v5.3]]
 
[[Category:Lianja v5.3]]

Latest revision as of 05:13, 6 March 2020

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.