BeanInfo
class.
onClick
event handler.
An event handler can perform two types of actions: internal actions that are the same for each instance of a button component, and external actions that differ by application or even by invocation within an application. For example, suppose an application instantiates two button components. Each button's internal action in response to an onClick
event might be to display momentarily the button in its clicked state before redisplaying it in its normal state. Externally, the onClick
event for one button might call a routine that submits the current data on a form to a database for one button, while the onClick
event for the other button might close the application.
NOTE: The VJS Developer's Guide describes how to use VJS to develop robust Web applications.The Component Developer's Guide is the document that describes what you need to know to create your own Netscape ONE components, install them in the VJS palette where you can use them to build Web applications, and deploy them with the applications you build.
Creating Components
The process for creating a component differs, depending on whether you use Java or JavaScript to create the component, and whether you are creating a CORBA component that is based on a CORBA object. The CDK documentation describes each creation process in a separate chapter.Creating Java-based Components
You create Java-based components using a Java development environment such as Visual Cafe, and the Java Development Kit (JDK) 1.1. Java-based components can be:The Component Developer's Guide assumes you are familiar with creating Java objects, applets, and Beans, so it does not instruct you on creating them. Using Java Objects as Components describes how to adapt Java objects, applets, and Beans for use as Netscape ONE components.
- applets
- objects
- JavaBeans
NOTE: You can also create JavaScript Bean (JSB) files as wrapper components for Java objects. Using JSB files as wrappers for Java objects enables you to hide component implementation details from the users of your components. For example, this is the only way to work with server-side Java components in VJS, and is typically used with LiveConnect to instantiate a Java class from JavaScript. The intention here is that only part of the underlying class need be exposed through the JSB file as long as the class can be instantiated using the JavaScript new operation. JSB File Structure Reference describes the JSB file format and provides a reference for its syntax.Creating JavaScript Components
VJS extends JavaScript by providing a JavaScript Beans (JSB) file format that enables you to create JavaScript components with properties, methods, and events. JSB files provide a convenient way to create reusable units of JavaScript code for commonly used objects, such as buttons, text fields, and radio buttons. Creating JavaScript Components describes how to create JavaScript components using a JSB file. JSB File Structure Reference provides a reference for JSB syntax; the JSB file format is modeled on easily constructed and readable SGML tagging conventions.Once you create JavaScript components, you install them into the VJS palette, where you can drag them into your applications and set their properties as appropriate.
Using CORBA Components describes these steps in more detail.Creating CORBA Components
Netscape ONE makes it possible for you to create CORBA components from your CORBA objects. Creating a CORBA component is a three-step process:
Installing Components in VJS
To use Netscape ONE components to build Web applications, you should install your components into a VJS palette. In general, Java and JavaScript components that consist of more than one file, such as a Java class that receives support from other Java classes, must be packaged into a JAR file. The JAR file must be installed in VJS. For CORBA objects, the installation process automatically creates a component in VJS from an IDL file. Regardless of the origin of your component, installation is an easy process that is described in general terms in the VJS Developer's Guide. Additional installation guidelines, specific to each type of component, may be found throughout the Component Developer's Guide as indicated below.
Installing Java Components
Because Java components typically consist of several class files, you must package the files into a JAR file, and then install the JAR file into VJS. Using Java Objects as Components describes the steps necessary for creating a Java component. Packaging Components for Import provides guidelines for using the JDK JAR packager to prepare a component for installation in the VJS palette.
Installing JavaScript Components
If a JavaScript component consists of a single JSB file, then you can install the component directly into a VJS palette. If your JavaScript component uses JS files to provide additional support routines, then you must package the JSB and JS files into a JAR file before installing the component in VJS. Creating JavaScript Components describes the steps necessary for creating a JavaScript component that consists of a stand-alone JSB file, and it describes how to install it in VJS. Packaging Components for Import provides guidelines for using the JDK JAR packager to prepare a multifile JavaScript component for installation in the VJS palette.
Installing CORBA Components
A CORBA component does not exist until you install a CORBA object's IDL file into VJS. Installation automatically creates a CORBA component, in the form of a JSB file that correlates to the IDL file. Using CORBA Components describes the installation process.
Deploying Components in Applications
Application deployment refers to how you package and deliver an application to your users. When you install components into VJS, and use them to build your application, VJS ensures that the necessary code for using the components at run time is automatically inserted into your application's code base. When you package your application, the components it uses are automatically packaged as part of the application. VJS manages component deployment based on how you installed the component into VJS itself. If you create components that consist of multiple files, properly package the component and all its support files in a JAR file, and install the JAR file into VJS, then VJS knows exactly how to deploy your component when you build and package your application. Deployment is a straightforward process described in the VJS Developer's Guide.
[Contents] [Previous] [Next] [Index]Last Updated: 11/20/97 13:56:30
Copyright © 1997 Netscape Communications Corporation