PopupAddRow(FieldName As String, FieldText As String

 

Appends FieldText in a new row to the end of the list of popup control FieldName.

 

Popup controls are used to offer a list of items to the user, in order to make a selection.

Unlike the combobox, here the user cannot add his own entries.

A popup list is typically created from a script or from a resultset of a database query.

 

 

Parameters:

 

Name

Type

Description

FieldName

String

ScreenFieldName of the control.

Ctrl+Click onto a control to retrieve its FieldName

(= ScreenFieldName)

FieldText

String

Text to be appended to the popup menu list

 

Available in:

 

WindowMain

WindowLink

YES

YES

 

Used in:

 

XojoScript Name

GUID

Registration Start

699835D7-DCA7-462E-8CC9-32829F495EDB

 

Hint: You can find 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 '%PopupAddRow%'

 

Example XojoScript:

 

Hint:         To run this script, select an address and choose menu Edit -> Register and then Script -> New Script Manager.

Paste the script to the editor and run it. See also PopupDeleteAllRows

 

// Run this code only if we are doing a seminar registration

If GetActiveLinking = "link_adr_evt" Then

 

// Retrieve last selected DocType

Dim DocType As String = GetText("imPO_lnk_p01_DocumentType")

 

// Add a list of document types to popup menu

PopupDeleteAllRows("imPO_lnk_p01_DocumentType")

PopupAddRow("imPO_lnk_p01_DocumentType","PDF Invoice")

PopupAddRow("imPO_lnk_p01_DocumentType","PDF Invoice with slip")

PopupAddRow("imPO_lnk_p01_DocumentType","Word Invoice")

PopupAddRow("imPO_lnk_p01_DocumentType","Word Reminder Invoice")

 

// Set default doctype to PDF Invoice

If DocType = "" Then

SetText("imPO_lnk_p01_DocumentType","PDF Invoice with slip")

Else

// Set selection back to last selected doctype

SetText("imPO_lnk_p01_DocumentType",DocType)

End If

 

End If // GetActiveLinking = "link_adr_evt"