Scripting Guide > Display Trees > Modal Windows in JSL > Constructors for Column Dialogs
Publication date: 07/08/2024

Constructors for Column Dialogs

You can use constructors such as Edit Number() and Check Box() in column dialogs, which construct launch windows with a column selector. The following example shows a typical column dialog with an Edit Number() box:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Column Dialog(
	ex x = ColList( "X", Max Col( 1 ) ),
	HList( "Alpha",
	ex = Edit Number( .05 ) )
);

Table 11.3 describes the column dialog constructors.

Notes:

A column dialog automatically includes the list of columns in the data table.

A column dialog also automatically includes OK, Cancel, and Remove buttons.

Table 11.3 Column Dialog Constructors

Constructor

Syntax

Explanation

Button

Button( "OK" ), Button( "Cancel" )

Draws an OK or a Cancel button. If OK is clicked, Button(1) is returned. If Cancel is clicked, Button(–1) is returned.

Check Box

var( CheckBox( "Text after box", <1|0> ) )

When OK is clicked, a selected check box assigns 1 to the variable. A check box that is not selected assigns 0 to the variable.

Add an optional 1 for the check box to be selected (on), or 0 for it to be not selected (off) when the window first appears. The default value is 0 (off).

Col List

var=Col List( "role", <MaxCol( n )>, <Datatype( type )> )

Creates a selection destination with a role button; the user’s choices are returned in a list item of the form var={choice 1, choice 2, …, choice n}.

You can specify the minimum and maximum number of columns using MinCol( n ) or MaxCol( n ).

You can specify the required data type of the column using Datatype(type). The choices for type are Numeric, Character, or Rowstate.

Combo Box

var( ComboBox( "choice1", "choice2", ...) )

Produces a menu with the choices listed. The first choice is the default. Choices evaluate to quoted text strings. Choices can also be inside a list.

Edit Number

var( Edit Number( number ) )

Produces an edit field for a number with number as the default value. When OK is clicked, the number entered in the field is assigned to the variable.

Edit Text

var( Edit Text( "string", <width(x)> ) )

Produces an edit field for a string with string as the default value. You can also specify the minimum width of the box in pixels. The default width is 72 pixels. When OK is clicked, the text entered in the field is assigned to the variable.

HList

HList( item, item, ... )

Top aligns and spaces the items in a horizontal row. Placing a pair of VLists within an HList produces a top aligned, spaced pair of columns.

Line Up Box

Line Up Box( n, item_11, item_12, ..., item_1n, ..., item_nn )

Lines up the items listed in n columns, where item_ij is the jth item of the ith row.

List Box

var=List Box(

{"item", "item",

...},

width( 50 ),

max selected( 2 ),

NLines( 6 )

)

Creates a display box that contains a list of items.

Radio Buttons

var( RadioButtons( "choice1", "choice2", ... ) )

Produces a vertical, left-justified list of radio buttons with the choices specified. The first choice is the default. When OK is clicked, the button that is selected is assigned to the variable. Choices must evaluate to quoted text strings.

string

"string"

Draws text in the window. For example, can include a labeling string before an Edit Number field. All strings must be quoted.

VList

VList( item, item, ... )

Left aligns and spaces the items in a vertical column. Placing a pair of HLists within a VList produces a left-aligned, spaced pair of rows.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).