Documentation

JQMSimplePopup

The JQMSimplePopup object displays a popup dialog box over the current page. The popup has a title, a message, content text, and up to two buttons. The popup dialog is displayed using the open() method, and dismissed when either of the buttons are tapped. The buttons can also be assigned event handlers.

By setting the object's properties, either at design-time in Handheld Designer, or at run-time in code, you can:

  • Set the popup's text with the title, message, and text properties.
  • Set the popup's appearance with the theme, headerTheme and contentTheme properties.
  • Define the transition used when showing the popup by setting the transition property.

Example:

// create a popup
var p = new JQMSimplePopup();
p.title = "The Title";
p.message = "Hello from the popup";
p.text = "This is the popup content text";
p.button1Label = "Close";
p.open();

For more detail, view the full object documentation on HandheldDesigner.com.

Object Properties & Methods

 button1LabelThe label of the popup's first button.
 button1ThemeThe color scheme used for the button.
 button2LabelThe label of the popup's second button.
 button2ThemeThe color scheme used for the button.
 contentThemeThe theme of the popup's content area.
 cornersDetermines whether to draw the popup with rounded corners.
 headerThemeThe theme of the popup's title header.
 idThe object's unique identifier. Also used as the variable name in code.
 inlineButtonsDetermines whether the popup's buttons appear inline.
 messageThe popup's message text.
 onButton1ClickEvent that occurs when the user touches the popup's first button.
 onButton2ClickEvent that occurs when the user touches the popup's second button.
 overlayThemeThe theme of the popup's background.
 shadowDetermines whether to draw a shadow around the popup.
 textThe main body text of the popup.
 themeThe color scheme used for the popup.
 titleThe title text to appear at the top of the popup.
 transitionPage transition used when displaying the popup.
 userdataAn object for storing user data.

button1Label

PropertyFirst available in version 1.4.0

The label of the popup's first button.

button1Theme

PropertyFirst available in version 1.4.0

The color scheme used for the button.

button2Label

PropertyFirst available in version 1.4.0

The label of the popup's second button.

button2Theme

PropertyFirst available in version 1.4.0

The color scheme used for the button.

contentTheme

PropertyFirst available in version 1.4.0

The theme of the popup's content area.

corners

PropertyFirst available in version 1.4.0

Determines whether to draw the popup with rounded corners.

headerTheme

PropertyFirst available in version 1.4.0

The theme of the popup's title header.

id

PropertyFirst available in version 1.4.0

The object's unique identifier. Also used as the variable name in code.

Example:

// get height of object with the id "object1".
var h = object1.height;

inlineButtons

PropertyFirst available in version 1.4.0

Determines whether the popup's buttons appear inline (in a horizontal row), or stacked vertically in the popup.

message

PropertyFirst available in version 1.4.0

The popup's message text.

onButton1Click

EventFirst available in version 1.4.0

Event that occurs when the user touches the popup's first button. The property is set by selecting an HDFunction object within Handheld Designer, or defined at runtime.

onButton2Click

EventFirst available in version 1.4.0

Event that occurs when the user touches the popup's second button. The property is set by selecting an HDFunction object within Handheld Designer, or defined at runtime.

overlayTheme

PropertyFirst available in version 1.4.0

The theme of the popup's background, which covers the entire window behind the popup.

shadow

PropertyFirst available in version 1.4.0

Determines whether to draw a shadow around the popup.

text

PropertyFirst available in version 1.4.0

The popup's main body text.

theme

PropertyFirst available in version 1.4.0

The color scheme used for the popup.

title

PropertyFirst available in version 1.4.0

The title text to appear at the top of the popup.

transition

PropertyFirst available in version 1.4.0

Page transition used when displaying the popup. Can be one of the following values:

  • "fade"
  • "pop"
  • "flip"
  • "turn"
  • "flow"
  • "slidefade"
  • "slide"
  • "slideup"
  • "slidedown"
  • "none" (or empty)

userdata

PropertyFirst available in version 1.4.0

An JavaScript object for storing user data. You can use this property to store data for later use. (For example, to share data between event handlers.)

Example:

// track the number of times a button is clicked:
function button1_onClick(event) {
	if(button1.userdata.timesClicked === undefined)
	{
		button1.userdata.timesClicked = 0;
	}
	else
	{
		button1.userdata.timesClicked++;
	}
}

Copyright © 2010-2017, Handheld Designer, LLC, All Rights Reserved.
Made by hand in New England, USA.