Adds a new row to a listbox.
The items of string array item()
are added as the fields of a new row to listbox listboxName .
Using the Layout Editor, one can add or modify custom listboxes to the databox of WindowMain or to WindowLink. The
contents of such listbox is saved into one database
field as a string, where each field and record is terminated by the EndOfField and EndOfRecord identifiers.
Parameters
:
Name |
Type |
Description |
listboxName |
String |
ScreenFieldName
of the listbox to add a new row. Ctrl+Click
onto a listbox to retrieve its listboxName (= ScreenFieldName) |
Item() |
Array of strings |
One dimensional string array where
the first element corresponds to the first field (column) of the new listbox row, and so forth. Use the XojoScript
Array () function to create the Item()
array. See example below . |
rowTag |
String |
An optional text which is stored with
the newly added row, without being displayed to the user. |
Available in:
WindowMain |
WindowLink |
YES |
YES |
Used in:
XojoScript
Name |
GUID |
Calculate total participation fee for
current attendee |
F0F802CC-D151-4F59-A749-1E232527D0C2 |
Add item and price to list in
finances |
DD3D67C8-08BF-409A-AB03-BC837BE68D9D |
Add code and prices to events |
A5CABD2D-92A3-494C-ADDF-8666611B3B6B |
Load seminar prices to registration |
1E3DB33D-DC46-46BB-8483-C15DBDF3A423 |
Calculate seminar participation fee |
2F6CFC74-44AB-4956-A760-BBD5E57595E8 |
Edit Registration |
89F9973D-C3A4-4466-BAE7-8AE85115AE09 |
Calculate participation fee for
seminar attendee |
032B50D3-D463-453E-9370-9AF7C34DA1D5 |
Add a Payment for Event participation |
877AA389-2167-4A95-904E-95C6329A2BFD |
Hint :
You can find more references to XojoScripts which
make use of this function by sending the following SQL statement to the
database :
Select id,GUID, ScriptName,ScriptCode from im_scripts
where ScriptCode Like '%ListAddRow%'
Example XojoScript:
// After the user has written a code and prices of an event to textfields,
// a pushbutton is clicked in order to launch the script below.
// The script takes the input from the textfields
and adds it
// as a new row to a listbox.
// Define listbox name
Dim lb As String = "imLB_evt_List3"
// Store contents of Textfield
Dim codeName
As String
codeName
= GetText ("imTF_evt_PriceCode"
)
If codeName
<> "" Then
// Create an array from TextField
values
Dim Arr()
As String = Array ( _
codeName,
_
GetText ("imTF_evt_Price"
), _
GetText ("imTF_evt_PriceEuro"
), _
GetText ("imTF_evt_TextD"
), _
GetText ("imTF_evt_TextE"
), _
GetText ("imTF_evt_TextF"
))
// Add record to Listbox
ListAddRow (lb,Arr)
// Clear input fields
SetText ("imTF_evt_PriceCode"
,"" )
SetText ("imTF_evt_PriceEuro"
,"" )
SetText ("imTF_evt_Price"
,"" )
SetText ("imTF_evt_TextD"
,"" )
SetText ("imTF_evt_TextE"
,"" )
SetText ("imTF_evt_TextF"
,"" )
Else
MsgBox ("You must provide a price code!" )
End if
// Set focus for next input
SetFocus ("imTF_evt_PriceCode"
)