The Common-Controls Tag Library

<ctrl:columnselect>

Generates a select column which uses an option list. The option element can be set individually for each row using the optionsProperty.

If the editable-attribut is set to true, the select control accepts user inputs.

The <columnselect>-tag may only be used within a Taghandler which implements the com.cc.framework.taglib.controls.ColumnContainerTag Interface. These are e.g. the <list>- or the <treelist>-tag.
../images/images/columnselect_small.gif

Body content: JSP
Tag class: ColumnSelectTag
Tei class: ColumnSelectTei
 

[ Syntax ]

Standard Syntax
<ctrl:columnselect
[ ajax = "Boolean" ]
[ align = "{left | right | center}" ]
[ disabled = "Boolean" ]
[ disableProperty = "String" ]
[ editable = "Boolean" ]
[ editableProperty = "String" ]
[ empty = "String" ]
[ filter = "boolean" ]
[ id = "String" ]
[ join = "{none | false | concatenate | true | separator}" ]
[ keyProperty = "String" ]
[ labelProperty = "String" ]
[ maxlength = "Integer" ]
[ multiple = "Boolean" ]
[ 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" ]
[ optionsProperty = "String" ]
[ permission = "ACL" ]
[ property = "String" ]
[ root = "Boolean" ]
[ size = "Integer" ]
[ sortable = "boolean" ]
[ style = "String" ]
[ styleClass = "String" ]
[ styleId = "String" ]
[ title = "String" ]
[ transaction = "Boolean" ]
[ type = "Java class (as a string literal)" ]
[ width = "String" ]
>
...Body Content...

</ctrl:columnselect>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
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" ?>
<ajax-response>
	<token/>
	<controls>
		<control styleId="" class="" name="">
			<html>
				<[CDATA[...]] >
			</html>
		</control>
	</controls>
</ajax-response>

				
 
alignAlignmentType Specifies the alignment of the column.
  • left = left alignment
  • right = right alignment
  • center = centered alignment
 
disabledBoolean Specifies if the cumn should be inaktive.

This attribute will only have effect if the column is editable.

 
disablePropertyString Specifies the name of a property which return a java.lang.Boolean value to disable the current row.

This attribute will only have effect if the column is editable.

Annotation: Valid Java identifier. The beans must implement a suitable property-getter method.

 
editableBoolean Specifies if the column is editable.  
editablePropertyString Indicates the name of a property, with the help of which the editable property can be disabled in the relevant line.

Annotation: Valid Java identifier/label. The Node-Beans must implement a suitable property-getter method.

 
emptyString A valid Java designator for a property which must be implemented by the collection  
filterboolean The automatic HTML coding of the column contents can be activated or disabled with the filter-attribute.  
idString The name of a page scope JSP bean that will contain the current element. Using the given Id, the row bean can be accessed in scripting expressions in the tag Body. The id must be a string literal because the JSP compiler generates a variable with this name at compile time

Annotation: A valid Java identifier must be given.

 
joinJoinMode This attribute will join the cell within the column with the cell of the previous column.

If the cell is embedded within a column group it can only be joined with cells within this column group

  • none = The cells will not be joined
  • false = The cells will not be joined (same as "none")
  • concatenate = The cells will be joined without a spacing
  • true = Same as "concatenate"
  • separator = The cells will be joined with a space
 
keyPropertyString Specifies the name of the property which returns the key for the option.

Annotation: Gültiger Java Bezeichner für ein Property welches von den Elementen der Aufzählung implementiert werden muss.

 
labelPropertyString Specifies the name of the property which returns the display value for the option. The character string is HTML-encoded before outputting.

Annotation: A valid Java designator for a property which must be implemented by the collection which provides the option for the select element.

 
maxlengthInteger Specifies the maximal number of characters which should be displayed in the column header and content. If the maxlength is exceeded, a hint "..." is displayed.
This functionality is not provided if the filter attribute is set to false. In this case the number of visible characters can not be detected, because the String can contain some html data.
 
multipleBoolean Enables or disables multiple selection  
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

 
optionsPropertyString Name of the property which returns an optionlist (OptionListDatamodel). All types of the <base:options>-tag are supported.

Annotation: A valid Java designator must be given.

 
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 The name of the property that contains the data of the column. There must be a corresponding property-getter implemented in the Row Bean.

With some column types, by returning a Boolean value, the relevant line can be activated or deactivated

Annotation: Valid Java identifier/label. The Row-Bean must implement a suitable property-getter method.

 
rootBoolean Specifies if the root element should be displayed. This is available for an option list based on a TreeNodeDataModel.  
sizeInteger The number of visible options.  
sortableboolean The attribute indicates whether sorting can be carried out according to this column. Here, if the value true is specified, then the user can toggle the sorting order with a click on the column header.  
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.

 
titleString Specifies the column title.

The character string is HTML-coded before outputting.

 
transactionBoolean This flag directs the framework to append a transaction token to all generated hyperlinks of the column. The transactio token allows the detection of form re-submissions (multiple submission of the same HTTP form).  
typeJava class (as a string literal) The fully qualified name of a Java class which should be used as a scripting variable.  
widthString Sets the width of the column. The width may be specified in absolute or percent terms.

See the HTML-documentation.

 

[ Example ]

Generates a List Control which uses a select column


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

<ctrl:list
   action="personBrowse"
   name="persons"
   title="Person List"
   rows="15">

   
   <ctrl:columnselect  title="Role"  property="userrole" optionsProperty="roleOptions"/>
</ctrl:list>