The Common-Controls Tag Library

<ctrl:button>

Generates a HTML-Button.

If the src-attribute is specified, an image button is generated.

If the text-attribute is specified a text button is generated. The text button uses different background images for the left, middle and right part of the button.

../images/images/button.gif

Body content: EMPTY
Tag class: ButtonTag
 

[ Syntax ]

Standard Syntax
<ctrl:button
[ action = "String" ]
[ base = "Directory or Resource key" ]
[ border = "Integer" ]
[ buttonStyle = "String" ]
[ disabled = "boolean" ]
[ filter = "boolean" ]
[ formElement = "boolean" ]
[ id = "String" ]
[ locale = "String" ]
[ name = "String" ]
[ onblur = "String" ]
[ onchange = "String" ]
[ onclick = "String" ]
[ oncontextmenu = "String" ]
[ ondblclick = "String" ]
[ onfocus = "String" ]
[ onkeydown = "String" ]
[ onkeypress = "String" ]
[ onkeyup = "String" ]
[ onmousedown = "String" ]
[ onmousemove = "String" ]
[ onmouseout = "String" ]
[ onmouseover = "String" ]
[ onmouseup = "String" ]
[ permission = "ACL" ]
[ property = "String" ]
[ runat = "{server | client | auto}" ]
[ scope = "{any | page | request | session | application}" ]
[ shadow = "boolean" ]
[ src = "String" ]
[ style = "String" ]
[ styleClass = "String" ]
[ styleId = "String" ]
[ tabindex = "Integer" ]
[ target = "String" ]
[ text = "String" ]
[ title = "String" ]
[ tooltip = "String" ]
[ width = "String" ]
/>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
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.

 
baseDirectory or Resource key Sets the base directory for a resource. The resource name will be prefixed with the name of the base directory. With localization enabled the value of the base attribute will be translated with the value stored in the ApplicationProperties.properties file.  
borderInteger Specifies the thickness of the border that has to be drawn around the control element.  
buttonStyleString Specifies an optional background image for the button. The images must be registered in the ResourceMap.  
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 The automatic HTML coding of the column contents can be activated or disabled with the filter-attribute.  
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.

 
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.

 
localeString enables localization for the control element. String literals will be interpreted as keys in the Application.properties 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.

 
onblurString Fires when the object loses the input focus.

Annotation: JavaScript Code

 
onchangeString Fires when the contents of the object or selection have changed.

Annotation: JavaScript Code

 
onclickString Fires when the user clicks the left mouse button on the object.

Annotation: JavaScript Code

 
oncontextmenuString Fires when the user clicks the right mouse button in the client area, opening the context menu.

Annotation: JavaScript Code

 
ondblclickString Fires when the user double-clicks the object.

Annotation: JavaScript Code

 
onfocusString Fires when the object receives focus.

Annotation: JavaScript Code

 
onkeydownString Fires when the user presses a key.

Annotation: JavaScript Code

 
onkeypressString Fires when the user presses an alphanumeric key.

Annotation: JavaScript Code

 
onkeyupString Fires when the user releases a key.

Annotation: JavaScript Code

 
onmousedownString Fires when the user clicks the object with either mouse button.

Annotation: JavaScript Code

 
onmousemoveString Fires when the user moves the mouse over the object.

Annotation: JavaScript Code

 
onmouseoutString Fires when the user moves the mouse pointer outside the boundaries of the object.

Annotation: JavaScript Code

 
onmouseoverString Fires when the user moves the mouse pointer into the object.

Annotation: JavaScript Code

 
onmouseupString Fires when the user releases a mouse button while the mouse is over the object.

Annotation: JavaScript Code

 
permissionACL With this attribute, access to the element can be restricted.

Authorizations are checked using the com.cc.framework.security.Principal object in the user session. The principal object is registered in the session with the method com.cc.framework.security.SecurityUtil#registerPrincipal(HttpSession, 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:

Literal
true|false -> com.cc.framework.security.StaticPermission
Role
#rolename -> com.cc.framework.security.RoleBasedPermission
Function
$functionname -> com.cc.framework.security.FunctionBasedPermission

 
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.

 
srcString Specifies the name of the Image Resource with the button image.

Name convention: The framework provides a mechanism for automatic image exchange when certain mouse events take place. In order that the mechanism can be used, the following rules apply:

  • The name of the button (specified in the name-attribute) must start with the prefix btn.
  • The filename of the gif image used must have the following format: xxxxxxxN.gif. where <N> stands for the button state.
A distinction is made between the following button states:
  • 1 = active (normal)
  • 2 = inactive (disabled)
  • 3 = hover (mouse over the button)
  • 4 = pressed

 
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.

 
tabindexInteger Tabulator Index for this element.  
targetString This attribute is used to set a HTML-target attribute.

Annotation: See HTML documentation for the attribute target.

 
textString The localized caption of the button. If this attribute is specified the button is rendered as a text button.  
titleString Is displayed in a Tooltip window when the user moves the mouse over the button.  
tooltipString A short descriptive text that is displayed when the user moves the mouse over the element.

The character string is HTML-encoded before outputting.

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

See the HTML documentation

 

[ Example ]

form element with button


<%@ taglib uri="http://www.common-controls.com/cc/tags-ctrl"    prefix="ctrl" %>

<ctrl:button  name="btnSearch"  src="images/buttons/btnSearch1.gif"/>