How Do I...

Prompt for text input

Prompt for path and file names No tip for this topic Example: Prompt for a new name Use view wrappers

At times, you need to prompt users for a string of text.

Adding a text prompter

To display a window into which users enter a text string, add a Text Prompter part:

  1. Go to a Composition Editor open on a visual part in your application.
  2. Select Prompter category icon (Prompter category) and Text Prompter icon (Text Prompter part).
  3. Click on the free-form surface.

Changing the settings for the prompter

Define what the prompter displays by changing its settings:

  1. Open the Text Prompter part's Properties window.
  2. Specify the title of the window, the messageString with the text you want to appear above the field where users type in text, and the defaultAnswerString with any default text.

Connecting the prompter to other parts

After you define a prompter, make an event-to-action connection so the prompter displays when the event occurs. Connect the event, such as clicked for a push button, to the prompt action of the Text Prompter part.

Also, make an attribute-to-attribute connection that passes the text entered as a parameter.

For more information on scripts and connections, see Connect scripts and parts to add function.


[ Top of Page | Previous Page | Next Page | Table of Contents ]