Reusable components – Apple WebObjects 3.5 Tools And Techniques User Manual

Page 85

Advertising
background image

Reusable Components

85

appears in your component, with its

code

attribute set to the name of

the file.

Drag an element from the Client-Side Components palette to your
component (see “Palettes”).

Reusable Components

One of the strengths of the WebObjects architecture is its support of
reusable components. Any component that you define, whether it
represents an entire page or part of a page, can be reused by any
WebObjects application. A component can be used in multiple pages or
even multiple times in the same page. Reusable components can be used
for such items as headers, footers, and navigation bars.

When a reusable component is used inside another component, it is
referred to as a child component; the containing component is called the
parent component.

To reuse a component, you can:

Add the component to a framework and include the framework in any
project that wants to use the component. The component is a shared
component
and doesn’t need to be copied into each application that uses
it.

Add the component directly to your project (in the Web Components
suitcase).

See “Frameworks” for information on creating frameworks and adding
them to a project. To add a component directly to a project, you can:

Drag a component (a folder with the .

wo

extension) from the file system

onto a component window.

You are asked whether you want to add the component to your project.
If you respond Yes, the component is copied to the project and placed
in the Web Components suitcase, along with all the other components.

The child component then appears in the window at the insertion
point. It is displayed graphically inside a custom WebObject element.

Advertising