Using Script Component Pad

  1. Introduction to Script Component Pad
  2. Understanding the Script Component Pad Interface
  3. Creating a New Script Component
  4. Working in Interface View

Introduction to Script Component Pad

Script Component Pad is intended to be used by ScriptBuilder developers who want to build ready-to-use script components that can be easily dropped into the ScriptBuilder Component Gallery. Script components are packages of JavaScript code that have a well defined interface of properties, events, and methods. A component is defined using XML to describe its structure and stored in a .scc file.

Major features of Script Component Pad include:

This documentation assumes you have some background in the following areas:


Understanding the Script Component Pad Interface

The user interface of Script Component Pad is task-oriented and is divided into two separate "views" or modes:


Creating a New Script Component

To create a new script component, follow the steps provided below after running the Script Component Pad.

  1. Create a new component.

    Click the New button on the toolbar (or choose New/Script Component from the File menu). The New Script Component dialog box appears.

  2. Name the component.

    Enter a name for the new component in the dialog box. The value you enter should be a fully qualified name for the component. For example: com.netobjects.SelectNav.

    Script Component Pad will display your new component in Component View.

  3. Define component attributes.

    In the Attributes pane, define the descriptor attributes for the script component. The attributes you define will be placed inside the <COMPONENT> tag in the .scc file.

  4. Add component descriptors.

    Add properties, methods, and events to the component by clicking on the associated toolbar button (or selecting New/xxx from the File menu).

    Tip: Use the right mouse button in the Component pane to display a popup menu to access the New commands.

    When you add a new descriptor, it will be added to the Component pane with the name of "Untitled". Change the name to something meaningful and click the Enter key to keep the name. Press the Tab key to move to the Attributes pane and around its fields.

  5. Write constructor function.

    When you have finished defining the component interface, click the Source Code tab to display the source code editor. Define the constructor function and any other supporting functions in the editor. All of the code entered will be contained in an accompanying .js include file when the component is saved.

  6. Save the component.

    When you are ready to save, click the Save button on the toolbar (or choose Save from the File menu). You will be prompted for the name of the .scc file. Click OK to save. Script Component Pad will save your component definition using XML tags in a .scc file.

You are now ready to install the script component to the ScriptBuilder Component Gallery.


Working in Interface View

In addition to adding component descriptors and attributes, you can also perform the following tasks in Interface View:

Renaming a Component or Component Descriptor

To rename a component or a component descriptor:

  1. Select the desired element in the Component pane.
  2. Press F2 to enter edit mode in the treeview. (Or right-click and choose the Rename command from the popup menu.)
  3. Enter a new name in the box provided and click Enter to keep changes.

Tip: Alternatively, you can change the Name field in the Attributes pane. The Component pane will automatically update.

Deleting a Component Descriptor

To delete a component descriptor:

  1. Select the desired component descriptor in the Component pane.
  2. Press the Delete key. (Or right-click and choose the Delete command from the popup menu.)
  3. You will be asked to confirm the delete. If you choose Yes, the component descriptor and its attributes will be removed from the component definition.

 

Last modified: September 22, 1998
Copyright ©1998 NetObjects, Inc.