Adding own components

  +  Overview

Composite components

Client components

  +  Setting up an own component library

Create a CaptainCasa project

Create the component library files

Check your project's classpath definition

Result

  +  Adding components - The server-side...

Define the component and its attributes

Add meta information

Define the “important” attributes

Define the “arrangement” of your component

For new attributes – Add some text and valid values

Implement the Component and the ComponentTag class

Result

  +  Adding components - The client-side...

Writing the JavaScript code

The JavaScript code of “coloredrect”

Result

  +  The client-side JavaScript framework

Documentation resources

JavaScript source code

Two JavaScript classes to develop

The “Element” class

Overview

Implementation

The “Component” class

Overview

Implementation

Adding events to the example

Listenering to events in the “Component” class

Continuing in the “Element” class

Continuing on server-side – Add “actionListener”

Continuing on server-side – Event class

Result