The Common-Controls Tag Library


Generates a tabset control element (cardex cards). The individual tabs of the control element can be directly specified in the JSP-Page with the help of the <tab>-tags.

Body content: JSP
Tag class: TabsetTag
Tei class: TabsetTei

[ Syntax ]

Standard Syntax
[ action = "String" ]
[ ajax = "Boolean" ]
[ bgcolor = "String" ]
[ border = "Integer" ]
[ disabled = "boolean" ]
[ filter = "boolean" ]
[ formElement = "boolean" ]
[ height = "String" ]
[ id = "String" ]
[ imagemap = "String" ]
[ labellength = "Integer" ]
[ locale = "String" ]
[ name = "String" ]
[ overlapping = "boolean" ]
[ permission = "ACL" ]
[ property = "String" ]
[ runat = "{server | client | auto}" ]
[ scope = "{any | page | request | session | application}" ]
[ shadow = "boolean" ]
[ stacked = "Boolean" ]
[ style = "String" ]
[ styleClass = "String" ]
[ styleId = "String" ]
[ summary = "String" ]
[ tabindex = "Integer" ]
[ tabs = "Integer" ]
[ transaction = "Boolean" ]
[ value = "String" ]
[ width = "String" ]
...Body Content...


[ Attributes ]

actionString Specifies the Struts Action that is to be called in case of control element events.

This attribute need not be specified if the tag is included within a Struts <html:form> tag. In that case, the name of the action is determined using the Struts Form Bean.

Annotation: The action must be declared in one of the struts-config.xml files.

ajaxBoolean Activates the AJAX function of the column. With AJAX all control events will be sent asynchronously to the application server where the processing takes place.

The event processing on the server is the same as without AJAX enabled. However the application developer has the possibility to control the response output through some additional methods of the AjaxRequest interface (the base class for ActionContext).

The normal AJAX server processing (-> AjaxRequest.isAjaxCanceled() == false) will send back a XML stream to the Web Browser. This stream contains only the HTML code for the dirty controls, which will be merged in the Browser through a JavaScript handler into the current HTML DOM Tree. So the Server will not transmit the full HTML page!

  • (+) The transfered HTML code is much smaller.
  • (+) The HTML page stays in the Browser window while the server request is being processed. So the screen will not "flicker".
  • (-) The browser will not keep track of AJAX requests in the navigation history!
  • (-) AJAX depends on JavaScript. Without JavaScript the event will result in a normal browser - server round trip.

Most of the Controls will add themselves to the dirty list of the ActionContext. This is done through a call to AjaxRequest.markDirty(). With this method the application developer has the opportunity to add additional controls to the dirty list and send them back to the browser in the XML stream. This is necessary when an event handler changes the state of a second control that was not the originator of the request.

In some cases it is not sufficient to send back only the dirty control because the whole HTML page has to be changed. In this cases the application developer can cancel AJAX server event processing by calling the AjaxRequest.cancelAjaxRequest() method. When the AJAY request is canceled the framework will send a full HTML page back to the Browser - as if this was a normal HTTP request.

The Common-Controls AJAX XML Protocol has the following format:

<?xml version="1.0" encoding="UTF-8" ?>
		<control styleId="" class="" name="">
				<[CDATA[...]] >

bgcolorString Sets the background color for the control element. This is important particularly if several tabsets are to be nested in one another. By means of different coloring, the user can better tell them apart.

Caution: For the specified color, the corresponding image resources for the DefaultPainter must be present - Example /fw/def/image/tab/tabLSel_<<COLORNAME>>.gif

Annotation: A valid HTML- color code must be specified. This can be a color code such as #ff0000 or a color name like e.g. Red.

borderInteger Specifies the thickness of the border that has to be drawn around the control element.  
disabledboolean This attribute can be used to disable the control element. It then does not accept any user inputs and does not generate any control element events.  
filterboolean Specifies if the labels on the tabs should be html encoded.  
formElementboolean This attribute is used to control how the control element should behave in case of a user action.
As form element
A submit of the surrounding form is carried out. All the information about the control element event is transported to the server in hidden fields.
As an independent control element
Control element events are directly triggered in the form of hyperlinks. All the data input in the HTML page is then lost.
Internally, this attribute is used to control how the control element should generate Painter links - as HTML-A tags or HTML-Input tags.

Annotation: The value true may only be used when the control element is situated in a form.

heightString Sets the height of the control element. The height may be specified in absolute or percent terms.

See the HTML documentation

idString The name of a page scope JSP bean that will contain the current element. Using the given Id, the variable can be accessed in scripting expressions in the tag Body. The id mus be a string lteral because the JSP compiler generates a variable withthis name at compile time

Annotation: A valid Java identifier must be given.

imagemapString With this attribute, an ImageList is assigned to the tabset, with the help of which images can be assigned to the individual tabs.

The image assignment is directly specified in the <tab>-element, during which the suffixes .sel or .unsel are implicitly appended, to be able to distinguish between the selected and unselected state.

Annotation: Under the name, there must be an Imagemap saved in the request.

labellengthInteger Specifies the maximum number of characters for the labels of the tab. If a label is longer, it is shortened with "...".  
localeString enables localization for the control element. String literals will be interpreted as keys in the file.

Annotation: boolean value true oder false oder the name of a locale.

nameString Specifies the name of the Java-Bean. The Java-Bean must be stored in the given scope.

When the tag is surrounded by a Struts <html:form> tag, no Bean Name need be specified. In this case, the Java-Bean is drawn via a property of the Struts Form Bean.

Annotation: A valid Java identifier must be given.

overlappingboolean Specifies if the tabs should be rendered operlapped.  
permissionACL With this attribute, access to the element can be restricted.

Authorizations are checked using the object in the user session. The principal object is registered in the session with the method, Principal). It is made available by the application developer by implementing the principal interface. In this manner, any authorization system can be very easily connected within the framework.

Authorizations are always specified in the form of an Access Control List (ACL). What is involved here is a semicolon-delimited list with individual authorizations. The framweork supports the following authorization types, which, however, can be expanded at will by the application developer:

true|false ->
#rolename ->
$functionname ->

propertyString Specifies the name of the property using which the Java-Bean is to be accessed. This is generally only necessary when the Java-Bean is associated with a Struts Form Bean.

Annotation: A valid Java identifier must be given.

runatRunAt This attribute specifies whether, for the control element, Clientside JavaScript should be used, or whether the control element should work purely with Server Roundtrips.
  • server = All control element actions result in a Server Roundtrip and are processed on the server.
  • client = control element actions are carried out directly in the browser of the user. It depends on the Painter Factory used and the specific control element, how far the support for Clientside Scripting goes!
  • auto = The framework selects based on the users browser settings "client" when JavaScript is enabled and "server" when JavaScript is disabled.
scopeHTTPScope This attribute shows the Scope in which the Java-Bean with the actual display data can be found.
  • any = The Bean is searched for in ever Scope.
  • page = The Bean exists as a local variable in the JSP Page.
  • request = The Bean is in the HTTP-Request.
  • session = The Bean is in the HTTP-Session.
  • application = The Bean is in the Servletkontext.
shadowboolean Specifies whether the control element should be saved with a shadow.

This function is only available in the case of specific Painterfactories.

stackedBoolean Specifies if the tabs should be stacked. This is usefully if a tabset contains a lot of tabs and if the not should be scrolled. If this attribute is set also the tabs-attribute needs to be specified.  
styleString An HTML-style can be directly specified with this attribute.

Annotation: See HTML documentation for the attribute style.

styleClassString The HTML-class attribute of the element can be specified with this attribute.

Annotation: See HTML documentation for the attribute class.

styleIdString The HTML-id attribute of the element can be specified with this attribute.

Annotation: See HTML documentation for the Attribute id.

summaryString This property can be used for rendering to non-visual media such as speech or Braille.  
tabindexInteger Tabulator Index for this element.  
tabsInteger Specifies the number of tabs shown simultaneously. If the control element has several tabs, buttons are provided for scrolling the tab list.  
transactionBoolean This flag directs the framework to append a transaction token to all generated hyperlinks. The transactio token allows the detection of form re-submissions (multiple submission of the same HTTP form).  
valueString Specifies the selected tab in the JSP page.  
widthString Sets the width of the control element. The height may be specified in absolute or percent terms.

See the HTML documentation


[ Server Events ]

public void control_onTabClick(
	ControlRequestContext ctx,
	String tabId) throws Exception

[ Example ]

Generates a simple Tabset with two tabs and an ImageMap.

<%@ taglib uri=""    prefix="ctrl" %>
<%@ taglib uri=""   prefix="util" %>

<util:imagemap name="im_tabs">
    <util:imagemapping  rule="def"        src="images/imgDefault.gif"   width="13"  height="13"/>
    <util:imagemapping  rule="cor.unsel"  src="images/imgCorUnsel.gif"  width="13"  height="13"/>
    <util:imagemapping  rule="cor.sel"    src="images/imgCorSel.gif"    width="13"  height="13"/>


    <ctrl:tab  id="DEF"  title="Default"      content="Page_Form_Def.jsp"  tooltip="Default View"  imageref="def"/>
    <ctrl:tab  id="COR"  title="Corrections"  content="Page_Form_Cor.jsp"  tooltip="Corrections"   imageref="cor"/>