2.1.2 What are Weblets and Weblet Templates?

Weblets are snippets of XSL code designed to encapsulate common HTML functions and, in doing so, hide their complexity. Weblet Templates are an additional level of granularity within a Weblet, defining sub-sections of the weblet XSL code applicable to a specific Technology Service and other possible conditions.

All weblets are stored in the LANSA repository and can be created, opened or modified in the LANSA Editor. Weblets, and consequently Weblet Templates, are reusable and can be dragged and dropped onto the Web Page of any webroutine to assist in building up the desired Presentation Layer or Web Design. While you can drag and drop both Weblets and Weblet Templates to get the same result (in most cases) it is useful to get into the habit of working with Weblet Templates to ensure the selected weblet is supported with the current Technology Service. The Weblet Groupings can also make it easier to locate the appropriate weblet to be used. For example, if you are using inline list there is a Weblet Template grouping Inline Templates to identify all the weblets defined to be "inline-aware" for the current Technology Service.

LANSA supplies a standard set of weblets. Weblets, like all XSL and XML objects in LANSA, are Technology Service specific. Most shipped weblets are supported for both Technology Services provided by LANSA, that is, XHTML (eXtensible Hypertext Markup Language) and JQMOBILE (jQuery Mobile).

Typically weblets are used to visualize data on a web page. For example standard weblets are provided to visualize a field as a checkbox or a radio button, or a working list could be visualized as a dropdown list or a tree. There are also standard weblets provided for formatting the layout of a web page, message presentation, menus and other elements commonly included on web pages that are not specifically related to data on the interface. Additional non-visualized weblets are provided to give access to commonly required information, for example the variables and style weblets (which are described in 2.5 Variables and 2.7 Cascading Style Sheets (CSS) and the Style Weblet).