How Do I ... : Work with complex parts : Add forms : Prompt for path and file names
Prompt for path and file names
Add formsAdd formsNo tip for this topicExample: Open and save filesExample: Open and save filesPrompt for text inputPrompt for text input
If your application uses files stored on disk, you might need to display a window that allows users to select a file to open or to save.
Adding a file selection prompter  
To display a window from which users can select a file, add a File Selection Prompter part:
1. Go to a Composition Editor open on a visual part in your application.
2. Select Prompter category icon (Prompter category) and File Selection Prompter icon (File Selection 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 File Selection Prompter part's Properties window.
2. Specify the title, any searchPath or selectedFileName, and the accessType as either XmOPEN or XmSAVE.
XmOPEN
Opens a designated file.
XmSAVE
Saves work to a designated file.
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 File Selection Prompter part.
Also, make an attribute-to-attribute connection that passes a path and file name as a parameter.
Last modified date: 08/14/2019