LANSA for the Web: Components
|Product/Release:||LANSA for the Web|
|Submitted By:||LANSA Technical Support|
Web components are one of the most powerful facilities available in LANSA for the Web. They can be used to quickly modify or extend an existing application.
Using the LANSA for the Web component technology, individual Web components (such as subroutines or modules of an application) can be defined and then be re-used in any application requiring these Web components. For example, a Web component can be defined which displays all the counties or states of a country as a drop down. Every screen displaying the county or state field can use the visual component. The Web component only has to be defined once and can be used as often as and whenever required.
The use of Web components simplifies the maintenance of the HTML pages (which LANSA automatically generates when a LANSA for the Web function is compiled on the AS/400). Modifications can be made to the components without having to re-compile the RDML, and without having to modify the HTML pages.
A LANSA for the Web component can be included in another Web component, as long as this does not cause recursive calls.
Web Component Types
Lansa for the Web supports the following component types:
General components (no HTML editor required):
- AS/400 File
This Web component can be used to define an AS/400 file which will store the HTML to be displayed on a Web page.
Example: a large text document has been created which is to be displayed as part of the Web page. The AS/400 file Web component only needs to be defined in the LANSA for the Web environment - no HTML code whatsoever needs to be written to be able to use it.
A Banner Web component allows the addition of advertising banners to a Web application. Several images can be connected to a banner and LANSA for the Web determines, via a sequence number' when defines which image should be displayed. The Banner Web component is defined in the LANSA for the Web environment and again no HTML code whatsoever needs to be maintained.
A Text Web component can be used to add lines of text to an application. The use of a text component allows the definition of a text string which can be changed as required without having to change the HTML code or recompiling the functions (e.g.: a page can contain a "news of the day").
HTML components (HTML editor required):
A Page Web component consists of a block of HTML code or an HTML page. Page Web components are useful if a standard piece of HTML code is required in one or more applications. The LANSA HTML Editor can be used to define this type of component.
Special input/output field components
Visual Web components can be used to manipulate the appearance of a field. They can be used to determine how a field should be displayed when using a Web browser. If a Visual Web component exists for a field in the LANSA Repository when a LANSA function using this field is compiled, the component is automatically included in the HTML generated by LANSA.
There are four types of Visual Web components:
- Check Box
- Drop Down
- List Box
- Radio Button
LANSA Web components are included in the generated HTML code via the LANSA tag <RDML COMPONENT>.