The Common-Controls Tag Library

<util:designrule>

The tag declares a rule which is used to modify the design of the surrounding element at runtime based on the specified expression. For example a rule can be used to change the stylesheet or to add a javascript handler for a single or for several table cells based on the cell (bean) value.
The <designrule>-Tag may only be used within a taghandler which implements the com.cc.framework.taglib.DesignRuleContainerTag. Examples of this are <list>- and the <columnXXX>-tags.
../images/images/designrule.gif

Tag class: DesignRuleTag
 

[ Syntax ]

Standard Syntax
<util:designrule
rule = "String"
[ onabort = "String" ]
[ onactivate = "String" ]
[ onafterprint = "String" ]
[ onafterupdate = "String" ]
[ onbeforeactivate = "String" ]
[ onbeforecopy = "String" ]
[ onbeforecut = "String" ]
[ onbeforedeactivate = "String" ]
[ onbeforeeditfocus = "String" ]
[ onbeforepaste = "String" ]
[ onbeforeprint = "String" ]
[ onbeforeunload = "String" ]
[ onbeforeupdate = "String" ]
[ onblur = "String" ]
[ onbounce = "String" ]
[ oncellchange = "String" ]
[ onchange = "String" ]
[ oncheck = "String" ]
[ oncheckall = "String" ]
[ onclick = "String" ]
[ oncollapse = "String" ]
[ oncontextmenu = "String" ]
[ oncontrolselect = "String" ]
[ oncopy = "String" ]
[ oncut = "String" ]
[ ondataavailable = "String" ]
[ ondatasetchanged = "String" ]
[ ondatasetcomplete = "String" ]
[ ondblclick = "String" ]
[ ondeactivate = "String" ]
[ ondrag = "String" ]
[ ondragend = "String" ]
[ ondragenter = "String" ]
[ ondragleave = "String" ]
[ ondragover = "String" ]
[ ondragstart = "String" ]
[ ondrop = "String" ]
[ onerror = "String" ]
[ onerrorupdate = "String" ]
[ onexpand = "String" ]
[ onexpandex = "String" ]
[ onfilterchange = "String" ]
[ onfinish = "String" ]
[ onfocus = "String" ]
[ onfocusin = "String" ]
[ onfocusout = "String" ]
[ onhelp = "String" ]
[ onkeydown = "String" ]
[ onkeypress = "String" ]
[ onkeyup = "String" ]
[ onlayoutcomplete = "String" ]
[ onload = "String" ]
[ onlosecapture = "String" ]
[ onmousedown = "String" ]
[ onmouseenter = "String" ]
[ onmouseleave = "String" ]
[ onmousemove = "String" ]
[ onmouseout = "String" ]
[ onmouseover = "String" ]
[ onmouseup = "String" ]
[ onmousewheel = "String" ]
[ onmove = "String" ]
[ onmoveend = "String" ]
[ onmovestart = "String" ]
[ onpaste = "String" ]
[ onpropertychange = "String" ]
[ onreadystatechange = "String" ]
[ onreset = "String" ]
[ onresize = "String" ]
[ onresizeend = "String" ]
[ onresizestart = "String" ]
[ onrowenter = "String" ]
[ onrowexit = "String" ]
[ onrowsdelete = "String" ]
[ onrowsinserted = "String" ]
[ onscroll = "String" ]
[ onselect = "String" ]
[ onselectionchange = "String" ]
[ onselectstart = "String" ]
[ onspindown = "String" ]
[ onspinup = "String" ]
[ onstart = "String" ]
[ onstop = "String" ]
[ onsubmit = "String" ]
[ onuncheck = "String" ]
[ onuncheckall = "String" ]
[ onunload = "String" ]
[ style = "String" ]
[ styleClass = "String" ]
[ styleId = "String" ]
/>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
onabortString Fires when the user aborts the download of an image.

Annotation: JavaScript Code

 
onactivateString Fires when the object is set as the active element.

Annotation: JavaScript Code

 
onafterprintString Fires on the object immediately after its associated document prints or previews for printing.

Annotation: JavaScript Code

 
onafterupdateString Fires on a databound object after successfully updating the associated data in the data source object.

Annotation: JavaScript Code

 
onbeforeactivateString Fires immediately before the object is set as the active element.

Annotation: JavaScript Code

 
onbeforecopyString Fires on the source object before the selection is copied to the system clipboard.

Annotation: JavaScript Code

 
onbeforecutString Fires on the source object before the selection is deleted from the document.

Annotation: JavaScript Code

 
onbeforedeactivateString Fires immediately before the activeElement is changed from the current object to another object in the parent document.

Annotation: JavaScript Code

 
onbeforeeditfocusString Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected.

Annotation: JavaScript Code

 
onbeforepasteString Fires on the target object before the selection is pasted from the system clipboard to the document.

Annotation: JavaScript Code

 
onbeforeprintString Fires on the object before its associated document prints or previews for printing.

Annotation: JavaScript Code

 
onbeforeunloadString Fires prior to a page being unloaded.

Annotation: JavaScript Code

 
onbeforeupdateString Fires on a databound object before updating the associated data in the data source object.

Annotation: JavaScript Code

 
onblurString Fires when the object loses the input focus.

Annotation: JavaScript Code

 
onbounceString Fires when the behavior property of the marquee object is set to "alternate" and the contents of the marquee reach one side of the window.

Annotation: JavaScript Code

 
oncellchangeString Fires when data changes in the data provider.

Annotation: JavaScript Code

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

Annotation: JavaScript Code

 
oncheckString Fires when a checkbox is checked

Annotation: JavaScript Code

 
oncheckallString Fires when all rows are checked

Annotation: JavaScript Code

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

Annotation: JavaScript Code

 
oncollapseString Fires when a tree node is collapsed

Annotation: JavaScript Code

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

Annotation: JavaScript Code

 
oncontrolselectString Fires when the user is about to make a control selection of the object.

Annotation: JavaScript Code

 
oncopyString Fires on the source element when the user copies the object or selection, adding it to the system clipboard.

Annotation: JavaScript Code

 
oncutString Fires on the source element when the object or selection is removed from the document and added to the system clipboard.

Annotation: JavaScript Code

 
ondataavailableString Fires periodically as data arrives from data source objects that asynchronously transmit their data.

Annotation: JavaScript Code

 
ondatasetchangedString Fires when the data set exposed by a data source object changes.

Annotation: JavaScript Code

 
ondatasetcompleteString Fires to indicate that all data is available from the data source object.

Annotation: JavaScript Code

 
ondblclickString Fires when the user double-clicks the object.

Annotation: JavaScript Code

 
ondeactivateString Fires when the activeElement is changed from the current object to another object in the parent document.

Annotation: JavaScript Code

 
ondragString Fires on the source object continuously during a drag operation.

Annotation: JavaScript Code

 
ondragendString Fires on the source object when the user releases the mouse at the close of a drag operation.

Annotation: JavaScript Code

 
ondragenterString Fires on the target element when the user drags the object to a valid drop target.

Annotation: JavaScript Code

 
ondragleaveString Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.

Annotation: JavaScript Code

 
ondragoverString Fires on the target element continuously while the user drags the object over a valid drop target.

Annotation: JavaScript Code

 
ondragstartString Fires on the source object when the user starts to drag a text selection or selected object.

Annotation: JavaScript Code

 
ondropString Fires on the target object when the mouse button is released during a drag-and-drop operation.

Annotation: JavaScript Code

 
onerrorString Fires when an error occurs during object loading.

Annotation: JavaScript Code

 
onerrorupdateString Fires on a databound object when an error occurs while updating the associated data in the data source object.

Annotation: JavaScript Code

 
onexpandString Fires when a tree node is expanded

Annotation: JavaScript Code

 
onexpandexString Fires when a tree node with unknown child count is expanded

Annotation: JavaScript Code

 
onfilterchangeString Fires when a visual filter changes state or completes a transition.

Annotation: JavaScript Code

 
onfinishString Fires when marquee looping is complete.

Annotation: JavaScript Code

 
onfocusString Fires when the object receives focus.

Annotation: JavaScript Code

 
onfocusinString Fires for an element just prior to setting focus on that element.

Annotation: JavaScript Code

 
onfocusoutString Fires for the current element with focus immediately after moving focus to another element.

Annotation: JavaScript Code

 
onhelpString Fires when the user presses the F1 key while the browser is the active window.

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

 
onlayoutcompleteString Fires when the print or print preview layout process finishes filling the current LayoutRect object with content from the source document.

Annotation: JavaScript Code

 
onloadString Fires immediately after the browser loads the object.

Annotation: JavaScript Code

 
onlosecaptureString Fires when the object loses the mouse capture.

Annotation: JavaScript Code

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

Annotation: JavaScript Code

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

Annotation: JavaScript Code

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

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

 
onmousewheelString Fires when the wheel button is rotated.

Annotation: JavaScript Code

 
onmoveString Fires when the object moves.

Annotation: JavaScript Code

 
onmoveendString Fires when the object stops moving.

Annotation: JavaScript Code

 
onmovestartString Fires when the object starts to move.

Annotation: JavaScript Code

 
onpasteString Fires on the target object when the user pastes data, transferring the data from the system clipboard to the document.

Annotation: JavaScript Code

 
onpropertychangeString Fires when a property changes on the object.

Annotation: JavaScript Code

 
onreadystatechangeString Fires when the state of the object has changed.

Annotation: JavaScript Code

 
onresetString Fires when the user resets a form.

Annotation: JavaScript Code

 
onresizeString Fires when the size of the object is about to change.

Annotation: JavaScript Code

 
onresizeendString Fires when the user finishes changing the dimensions of the object in a control selection.

Annotation: JavaScript Code

 
onresizestartString Fires when the user begins to change the dimensions of the object in a control selection.

Annotation: JavaScript Code

 
onrowenterString Fires to indicate that the current row has changed in the data source and new data values are available on the object.

Annotation: JavaScript Code

 
onrowexitString Fires just before the data source control changes the current row in the object.

Annotation: JavaScript Code

 
onrowsdeleteString Fires when rows are about to be deleted from the recordset.

Annotation: JavaScript Code

 
onrowsinsertedString Fires just after new rows are inserted in the current recordset.

Annotation: JavaScript Code

 
onscrollString Fires when the user repositions the scroll box in the scroll bar on the object.

Annotation: JavaScript Code

 
onselectString Fires when the current selection changes.

Annotation: JavaScript Code

 
onselectionchangeString Fires when the selection state of a document changes.

Annotation: JavaScript Code

 
onselectstartString Fires when the object is being selected.

Annotation: JavaScript Code

 
onspindownString Fires when a spin-down button is clicked

Annotation: JavaScript Code

 
onspinupString Fires when a spin-up button is clicked

Annotation: JavaScript Code

 
onstartString Fires at the beginning of every loop of the marquee object.

Annotation: JavaScript Code

 
onstopString Fires when the user clicks the Stop button or leaves the Web page.

Annotation: JavaScript Code

 
onsubmitString Fires when a FORM is about to be submitted.

Annotation: JavaScript Code

 
onuncheckString Fires when a checkbox is unchecked

Annotation: JavaScript Code

 
onuncheckallString Fires when all rows are unchecked

Annotation: JavaScript Code

 
onunloadString Fires immediately before the object is unloaded.

Annotation: JavaScript Code

 
ruleString A regular expression which is used to select a design rule. Within this expression the current bean can be accessed to check a property value.

Annotation: A valid, regular expression is expected.

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.

 

[ Example ]

The example shows the usage of design rules for rows and columns within a ListControl.


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

<ctrl:list
    styleId="myListControl"
    action="sample109/userBrowse"
    name="users"
    title="user.list.title"
    width="550"
    rows="10"
    refreshButton="true"
    createButton="$user.create"
    noframe="true"
    pageButtons="3">


    <%--  Row based Design Rules  --%>
    <util:designrule
        rule="@{bean.userId == 'MUD'}"
        style="background-color: red; font-weight: bold;"/>

    <util:designrule
        rule="@{bean.userId == 'HOP'}"
        style="background-color: #AAAAAA; font-weight: bold; line-height: 28px;"/>

    <util:designrule
        rule="@{bean.userId == 'FAS'}"
        style="background-color: braun; font-weight: bold; text-transform: uppercase;"/>


    <ctrl:columndrilldown   title="user.list.id"  property="userId"  width="65">
        <%--  Column based Design Rules  --%>
        <util:designrule
            rule="@{bean.userId != 'MUD'}"
            style="background-color: #80ADBA;"/>

    </ctrl:columndrilldown>

    <ctrl:columntext  title="user.list.name"  property="name"  width="200">
        <%--  Column based Design Rules  --%>
        <util:designrule
            rule="@{bean.userId == 'ELK'}"
            style="font-style : italic; color: navy; font-weight: bold;"
            onmouseover="javascript:this.title='${bean.name}';"/>

      <util:designrule
          rule="@{bean.userId == 'DIS'}"
          style="background-color: brown; letter-spacing: 2px; text-align: right;"/>

    </ctrl:columntext>
</ctrl:list>