Skip navigation links
ApplinX 10.5.0.0000 API Specification

Package com.sabratec.j2ee.framework.web.tags

Overview

The purpose of this package is to provide the developer the ability to add "HTML like" tags to the JSP page.

See: Description

Package com.sabratec.j2ee.framework.web.tags Description

Overview

The purpose of this package is to provide the developer the ability to add "HTML like" tags to the JSP page. Though this is done without writing any code inside the tags, it is still possible to set dynamic contents to the tags.

This package contains tag library classes and a tag accessor which allows setting dynamic content to the HTML output of the tags.
The final HTML result of each tag is the matching HTML tag with dynamic content/attributes, added dynamically.

Each JSP page must be associated with a Java class that contains an instance of the tags accessor.
The tags accessor sets dynamic content to the tags.
The association is established by setting a root tag: <gx:html gx_context="">

Tip: If you don't set a context class the page will work in design mode, and will not be connected to a data source (such as ApplinX) in the context class.
The HTML tag class starts the life cycle of the page:
gx_onInit -> gx_onLoad -> Post back (submit) -> gx_preRender -> gx_onUnload
these are all functions where you can use the object instance of the tags accessor getTagsAccesor() in order to pass dynamic content to each tag.
The association to each tag is established by setting an ID to each tag, and specifying the ID of the tag in the tags accessor's various methods.

Using the Tag Library

To set a dynamic content to a tag for example, set the following code:

In SamplePage.JSP:
<gx:html gx_context="contexts.SamplePage">
...
<gx:input id=”UserName” cssClass=”field1”/>


In SamplePage.java:
String user = “newUser”; // can be retrieved from any data source.
getTagsAccesor().setTagContent(“UserName”, user)

The result will be:
<input id=”UserName” name=”UserName ”class=”field1” value=”newUser”/>

Configuration
Note: The following configuration is ready for use in any ApplinX application for JSP.
Check that the tag library contains the following components:
The classes in this package are abstract in order to allow the developer to extend them easily.
For this purpose, in each new ApplinX project for JSP there is a tags folder in WEB-INF/classes, which contains Java classes. Each class in the tags folder inherits from an abstract tag class in the tag library.
Associating the tags to the tags' classes is done in GXTags.tld.
The tags project classes folder is associated to the GXTags.tld file (and not directly to the tag library classes) in order to have immediate affect when a developer changes the relevant tag (in the project's tags folder).
Skip navigation links
ApplinX API Specification

Copyright 2018 Software AG. All rights reserved. Use is subject to license terms.