Web Component Framework Tags (en)

Web Component Framework (WCF) tag library. A collection of reuseable JSP tags like tree, table, HTML form and XSL rendering. WCF uses the BeanUtils package as its expression language EL.

Content


calendar

Body Contenttagdependent
Description Creates required javascript-modifications for the calendar-control in a wcf-form

AttributeRequiredTypertexprDescription

Example

<wcf:calendar/>

catedit

Body ContentEMPTY
Description Creates a categoy editor component. This component does not produce visible output directly, it must be rendered via the WCF render tag.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
validatefalsebooleantrue if set to true, then user input will be automatically verified, even if the button of another component was pressed. Both components must be part of the same HTML form element to make this work.
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
modelfalseStringtrue EL expression that resolves to a com.tonbeller.wcf.catedit.CategoryModel

Example



charset

Body Contentempty
Description prints the character encoding configured in the charset filter.

AttributeRequiredTypertexprDescription

Example

<meta http-equiv=Content-Type content="text/html; charset=<wcf:charset/>">
    

confirm

Body Contenttagdependent
Description A confirmation dialog. Used by other Components, not stand-alone

AttributeRequiredTypertexprDescription
idfalseStringtrue Name of the session attribute created by this tag. Defaults to "confirmForm"
xmlUrifalseStringtrue URI of the form XML. Defaults to "/WEB-INF/wcf/confirm.xml"
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
validatefalsebooleantrue if set to true, then user input will be automatically verified, even if the button of another component was pressed. Both components must be part of the same HTML form element to make this work.

Example

<wcf:confirm id="confirmForm"  xmlUri="/WEB-INF/wcf/confirm.xml" visible="false"/>

connect

Body ContentEMPTY
Description Deprecated. Use "validate" attribute of WCF components instead, which is more natural and will be sufficient most of the time. Connects different WCF Components. This makes the buttons of one form act on another form too. If a tree and a form are connected for example, pressing the OK button in the form will make the tree read its selection.

AttributeRequiredTypertexprDescription
form1trueStringtrue Form 1
form2trueStringtrue Form 2

Example

<jsp:useBean id="testbean" class="com.tonbeller.wcf.form.TestBean" scope="session" />
<wcf:form id="formcomp" xmlUri="/WEB-INF/formdemo.xml" model="#{testbean}"/>
<wcf:tree id="tree01"/>
<wcf:connect form1="#{formcomp}" form2="#{tree01}"/>

<form action="formdemo.jsp" method="POST" id="form01">
  <wcf:render ref="#{formcomp}" xslUri="/WEB-INF/wcf/wcf.xsl" xslCache="true"/>
  <wcf:render ref="#{tree01}" xslUri="/WEB-INF/wcf/wcf.xsl" xslCache="true">
    <wcf:renderParam name="border" value="1"/>
  </wcf:render>
</form>
    

contentType

Body Contentempty
Description sets the content-type of the response and appends ";charset=xxx" where xxx is the charset that is configured in the CharsetFilter.

AttributeRequiredTypertexprDescription
typetrueStringtrue mime type, e.g. "text/html"

Example

<wcf:contentType type="text/html"/>
will set the content-type to
  "text/hmtl; charset=UTF-8"
if UTF-8 is configured in the CharsetFilter.
    

evenOdd

Body Contentempty
Description appends "-even" or "-odd" to its class attribute depending on the current loop status.

AttributeRequiredTypertexprDescription
clazzfalseStringtrue Name of the CSS class prefix
evenfalseStringtrue if clazz == null: string printed on even rows
oddfalseStringtrue if clazz == null: string printed on odd rows

Example

      <style>
        td.mytable-even { ... }
        td.mytable-odd { ... }
      </style>
      ...
      <c:forEach ...>
        <td class="<wcf:evenOdd clazz='mytable'/>">
        ...
        <!-- produces the same result as above -->
        <td class="<wcf:evenOdd even='mytable-even' odd='mytable-odd'/>">
      </c:forEach>

form

Body Contenttagdependent
Description Creates an HTML form that is defined by an XML file. This component does not produce visible output directly, it must be rendered via the WCF render tag.

Structure of the XML File

<xform style="twocolumn">
  <title value="Form Demo">
    <imgButton label="Cancel" .../>
  </title>
  <textField type="int" modelReference="intValue" label="Count" .../>
  <checkBox modelReference="nestedBean.boolValue" label="Check Me" .../>
</xform>
creates a Form with a title, a close button in the upper right corner, a text input field and a check box.

Data binding

The form component is associated with a JavaBean. The input elements of the HTML form are bound to the bean properties via the modelReference attribute. The bean in the above example has an int property with the name intValue that can be modified by the <textField ...>. As shown in the check box example, the modelReference may contain an EL (JSTL Expression Language) expression.

Valid type attribute values:
  • boolean
  • string
  • date
  • int
  • posint - integer >= 0
  • double
  • email

Element IDs

The names of the HTTP parameters are generated by random. If this is not desired, you can use the id attribute.
<xform style="twocolumn">
  <textField id="field1" .../>
  <checkBox id="$id.field2" .../>
</xform>
creates two HTML input fields, the first with name="field1", the second with name="myform.field2", where myform is the id attribute of this form tag.

Form Elements

The elements are rendered via /WEB-INF/wcf/controls.xsl. Please look there for details.
  • label
  • textField
  • textArea
  • password
  • checkBox
  • radioButton
  • listBox1
  • listBoxN
  • imgButton
  • button
Use disabled="true" to make elements read-only.

Use required="true" if user input is required.

Form Buttons

Buttons must have either a "handler" or an "actionReference" attribute. "handler" specifies a class that implements the NodeHandler interface which may handle requests, change button label etc. Use of "actionReference" is much easier and recommended, "actionReference" is the name of a method in the bean, that takes a single argument of type RequestContext. This method is invoked when the user presses the button.
  • action="revert" - calls revert() on the Form, i.e. reads the bean properties and formats the data for presentation.
  • action="validate" - calls validate() on the Form, i.e. parses user input and writes the values to the bean properties
  • forward="/some/page.jsp" - if validation succeeds forwards to another page. Paramers make sense here.
  • hide="true" - if validation succeeds hides the component
  • successAttr="name-of-request-attribute" - if validation succeeds a request attribute with value true is created.
  • handler="fully.qualified.ClassName" - name of a class that implements NodeHandler and is responsible for this node
  • actionReference="methodName" the name of a method that takes an RequestContext as its argument.

Bookmark support

see com.tonbeller.wcf.bookmark. The content of the editable bean properties can be collected and restored via the Bookmarkable interface. To enable this, the tag attribute "bookmarkable" must be set to true.

Examples

See working examples in /WEB-INF

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
xmlUritrueStringtrue Path of an XML config file that describes the HTML form, relative to the application context. There may be different form descriptions for different Locales, the stylesheet will be choosen upon similar rules to ResourceBundle.

Example: xmlUri='/WEB-INF/myform.xml'. For a german Browser WCF will try to load /WEB-INF/myform_de.xml. If this fails, it will load /WEB-INF/myform.xml.
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
validatefalsebooleantrue if set to true, then user input will be automatically verified, even if the button of another component was pressed. Both components must be part of the same HTML form element to make this work.
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
bundlefalseStringtrue ResourceBundle for i18n replacements. If a text- or attributenode in xml starts with 'fmt:' the remaining text will be interpreted as key into the resource bundle.
modeltrueStringtrue EL expression that resolves to the bean that shall be edited
bookmarkablefalsebooleantrue true|false indicating whether this form shall save its beans state. Default is false
finishButtonfalsebooleantrue true|false indicating whether this form supports finish if it is not the last page of a wizard. Default is true

Example

<jsp:useBean id="testbean" class="com.tonbeller.wcf.form.TestBean" scope="session" />
<wcf:form id="formcomp" xmlUri="/WEB-INF/formdemo.xml" model="#{testbean}"/>
<form action="formdemo.jsp" method="POST" id="form01">
  <wcf:render ref="#{formcomp}" xslUri="/WEB-INF/wcf/wcf.xsl" xslCache="true"/>
</form>

Example

<xform style="twocolumn">
  <title value="fmt:fetch.title.from.resource.bundle">
    <imgButton id="cancel" src="wcf/form/cancel.png" action="revert" label="Cancel" forward="tabledemo.jsp" handler="com.tonbeller.wcf.form.ButtonHandler"/>
  </title>

  <!-- Text control -->
  <textField id="string" type="string" modelReference="stringValue" label="Text:"    value="" title="please enter some text"/>
  <textField id="int"    type="int"    modelReference="intValue"    label="Integer:" value="" title="please enter an integer"/>
  <textField id="double" type="double" modelReference="doubleValue" label="Decimal number:"    value="" title="please enter a decimal number"/>
  <textField id="date"   type="date"   modelReference="dateValue"   label="Date:"    value="" title="please enter a date"/>
  <textField id="dateTime" type="dateTime"   modelReference="dateTimeValue"   label="Date/Time:"    value="" title="please enter a date/time"/>

  <!-- Password control -->
  <password id="password" type="string" modelReference="password" label="Password:" value=""/>

  <!-- Text area -->
  <textArea id="textarea" rows="7" cols="40" type="string" modelReference="textArea" label="Text area:" value="This is a text area"/>

  <checkBox id="checkbox1" modelReference="checkBox1" label="check box 1"/>
  <checkBox id="checkbox2" modelReference="checkBox2" label="check box 2"/>

  <!-- ListBox, single selection -->
  <listBox1 id="list1" type="int" modelReference="list1" label="List, single selection:">
    <listItem id="list1.1" value="1" label="list item 1"/>
    <listItem id="list1.2" value="2" label="list item 2"/>
    <listItem id="list1.3" value="3" label="list item 3"/>
    <listItem id="list1.4" value="4" label="list item 4"/>
  </listBox1>


  <!-- ListBox, multiple selection -->
  <listBoxN id="listN" type="int" modelReference="listN" label="List, multiple selection:">
    <listItem id="listN.1" value="1" label="list item 1"/>
    <listItem id="listN.2" value="2" label="list item 2"/>
    <listItem id="listN.3" value="3" label="list item 3"/>
    <listItem id="listN.4" value="4" label="list item 4"/>
  </listBoxN>


  <!-- ListBox, single selection, dynamic item list -->
  <listBox1 id="listbox" type="int" modelReference="dynList" label="List, dynamic content:" handler="com.tonbeller.wcf.form.TestItems"/>

  <label label="This is a label" value="value attribute goes here"/>
  <label label="Dynamic label (content from TextArea)" modelReference="textArea"/>

  <radioButton id="radio1" modelReference="radioButton1" group-id="group1" label="radio button 1"/>
  <radioButton id="radio2" modelReference="radioButton2" group-id="group1" label="radio button 2"/>

  <buttons>
    <button id="cancel" action="revert" label="Cancel" forward="tabledemo.jsp" handler="com.tonbeller.wcf.form.ButtonHandler"/>
    <button id="revert" action="revert" label="Revert" handler="com.tonbeller.wcf.form.ButtonHandler"/>
    <button id="validate" action="validate" label="Validate" handler="com.tonbeller.wcf.form.ButtonHandler"/>
    <button id="ok" action="validate" label="OK" forward="tabledemo.jsp" handler="com.tonbeller.wcf.form.ButtonHandler"/>
  </buttons>

</xform>
    

formbutton

Body Contentempty
Description Submit button for a WCF form

AttributeRequiredTypertexprDescription
idtrueStringtrue ID of the button. The button may be accessed in EL as TOOLBAR_ID.buttons.BUTTON_ID
imgtrueStringtrue Name of the image to use. The generated URLs are APPCONTEXT/wcf/toolbar/IMG-up.png and APPCONTEXT/wcf/toolbar/IMG-down.png
radioGroupfalseStringtrue Name of a radio group. At most one button of a group may be pressed.
tooltipfalseStringtrue name of the tooltip in the toolbars ResourceBundle
visibleReffalseStringtrue Either true, false or an EL expression that evaluates to a boolean property. The button will be visible only, if that property is true
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
actionfalseStringtrue either "revert" or "validate"
forwardtrueStringtrue URI of the JSP to display if validation succeeds
formtrueStringtrue EL expression that evaluates to the form to validate

Example

<jsp:useBean id="testbean" class="com.tonbeller.wcf.form.TestBean" scope="session" />
<wcf:form id="formcomp" xmlUri="/WEB-INF/formdemo.xml" model="#{testbean}"/>
<wcf:toolbar id="toolbar01" bundle="com.tonbeller.wcf.toolbar.resources">
  <wcf:formbutton ... action="validate" forward="newpage.jsp" form="#{formcomp.form}"/>
</wcf:toolbar>
    

ifRole

Body ContentJSP
Description A conditional tag that tests if the user holds some role.

AttributeRequiredTypertexprDescription
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.

Example

<wcf:ifRole role="tomcat">
  <h1>Hi, Tomcat</h1>
</wcf:ifRole>
    

imgbutton

Body Contentempty
Description A toolbar button with a static hyperlink

AttributeRequiredTypertexprDescription
idtrueStringtrue ID of the button. The button may be accessed in EL as TOOLBAR_ID.buttons.BUTTON_ID
imgtrueStringtrue Name of the image to use. The generated URLs are APPCONTEXT/wcf/toolbar/IMG-up.png and APPCONTEXT/wcf/toolbar/IMG-down.png
tooltipfalseStringtrue name of the tooltip in the toolbars ResourceBundle
visibleReffalseStringtrue Either true, false or an EL expression that evaluates to a boolean property. The button will be visible only, if that property is true
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
hreftrueStringtrue the href attribute of the hyperlink. "{0}" is replaced with the context, "{1}" with a random string.
targetfalseStringtrue the target attribute of the hyperlink

Example

<wcf:imgbutton  id="button5" img="button" href="/some/path" visibleRef="#{toolbean.checkBox1}"/>

include

Body ContentEMPTY
Description Includes a JSP page if a certain HTTP parameter is present. The name of the file is prefix + paremeter + suffix.

For example, if prefix="/WEB-INF/mypages/", httpParam="page" and suffix=".jsp", then the URL ?page=page20 will include the file /WEB-INF/mypages/page20.jsp. If the parameter page is not present in the HTTP request, no page will be included.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
httpParamtrueStringtrue name of the HTTP parameter
prefixfalseStringtrue Prefix
suffixfalseStringtrue Suffix

Example

<wcf:include id="include01" httpParam="query" prefix="/WEB-INF/queries/" suffix=".jsp"/>

linkAction

Body ContentJSP
Description when the user clicks on the link, a method in the target bean is invoked.

AttributeRequiredTypertexprDescription
targettrueStringtrue EL that evaluates to the target bean
methodtrueStringtrue name of the method. The method must have the signature void methodName(RequestContext context) throws Exception;

Example

      <paramLinkGroup id="myParam">
        ...
        <wcf:paramLink page="/customer.jsp">
          click here!!
          <wcf:linkParam
            name="CUSTOMERID"
            sqlValue="${result.customerId}"/>
          <wcf:linkAction
            target="${customerViewHelper}"
            method="onClick"/>
        </wcf:paramLink>
        ...
      </paramLinkGroup>
    

linkParam

Body ContentJSP
Description adds another SessionParam to a paramLink tag. Must be nested inside a paramLink tag.

AttributeRequiredTypertexprDescription
paramNametrueStringtrue Name of the SessionParam
displayNamefalseStringtrue visible name of the SessionParam
displayValuefalseStringtrue visible value of the SessionParam
sqlValuefalseStringtrue SQL value of the SessionParam
mdxValuefalseStringtrue MDX value of the SessionParam
textValuefalseStringtrue Text constant as value of the SessionParam

Example

      <paramLinkGroup id="myParam">
        ...
        <!-- single parameter -->
        <wcf:paramLink
          page="/customer.jsp"
          name="CUSTOMERID"
          sqlValue="${result.customerId}">
          click here!!
        </wcf:paramLink>
        ...
        <!-- multiple parameters -->
        <wcf:paramLink page="/customer.jsp">
          click here!!
          <wcf:linkParam
            name="CUSTOMERID"
            sqlValue="${result.customerId}"/>
          <wcf:linkParam
            name="SCOREID"
            sqlValue="${result.scoreId}"/>
        </wcf:paramLink>
        ...
      </paramLinkGroup>
    

logform

Body ContentJSP
Description An HTML form that allows to set logging options for Apache log4j

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
validatefalsebooleantrue if set to true, then user input will be automatically verified, even if the button of another component was pressed. Both components must be part of the same HTML form element to make this work.
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
xmlUritrueStringtrue Path of an XML config file that describes the HTML form, relative to the application context. There may be different form descriptions for different Locales, the stylesheet will be choosen upon similar rules to ResourceBundle.

Example: xmlUri='/WEB-INF/myform.xml'. For a german Browser WCF will try to load /WEB-INF/myform_de.xml. If this fails, it will load /WEB-INF/myform.xml.
logDirtrueStringtrue Name of a directory relative to user.home or - in case of missing write permissions - relative to java.io.tmpdir. This directory contains the configuration files for log4j, default configuration files are created.

Example

<wcf:logform id="logdemo" xmlUri="/WEB-INF/logdemo.xml" logDir=".wcf/logging"/>
<form action="logdemo.jsp" method="POST" id="logform">
  <wcf:render ref="logdemo" xslUri="/WEB-INF/wcf/wcf.xsl" xslCache="true"/>
</form>
    

pageStack

Body ContentJSP
Description shows the current position to the user, e.g. you are here: Page 1 : Page 2

AttributeRequiredTypertexprDescription
varfalseStringtrue Name of the loop variable which is of type com.tonbeller.wcf.pagestack.Page
pagefalseStringtrue url of the current page
pageIdfalseStringtrue identifies this entry. If not set, the page attribute is taken. This way one JSP can be replaced with another.
titlefalseStringtrue title of the current page
keyfalseStringtrue fetches the title for this page from the current JSTL resource bundle (same as JSTL's <fmt:message../> for example)
clearfalsebooleantrue clears the stack before adding this page
varStatusfalseStringtrue Name of the JSTL LoopTagStatus Object. See details in JSTL documentation
bundlefalseStringtrue ResourceBundle for i18n replacements

Example

      <div class="pagestack">
        You are here:
        <wcf:pageStack var="p" varStatus="status" page="thispage.jsp" title="This Page Title">
          <c:if test="${not status.first}">
            &gt;
          </c:if>
          <a href="<c:out value='${p.page}'/>"><c:out value="${p.title}"/></a>
        </wcf:pageStack>
      </div>
    

paramLink

Body ContentJSP
Description Outputs an <a href="..."> hyperlink. Stores a List of SessionParam's and Actions. If the user clicks on the hyperlink, the SessionParam instances will be activated, i.e. they will be set into the SessionParamPool. Then the actions are executed. Finally it forwards to the target page.

A single parameter may be specified through attributes of this tag, if multiple parameters are required, nested linkParam tags may be used.

The generated URL is "secure" because it contains a random number only. Users can not change it in the browsers location field for example.

AttributeRequiredTypertexprDescription
pagefalseStringtrue target page
targetfalseStringtrue HTML target base
tokenfalsebooleantrue Set to "true" to enerate a token into the URL to prevent the user from using the browser's back button. Defaults to "false".
paramNamefalseStringtrue Name of the SessionParam
displayNamefalseStringtrue visible name of the SessionParam
displayValuefalseStringtrue visible value of the SessionParam
sqlValuefalseStringtrue SQL value of the SessionParam
mdxValuefalseStringtrue MDX value of the SessionParam
textValuefalseStringtrue Text constant as value of the SessionParam

Example

      <paramLinkGroup id="myParam">
        ...
        <!-- single parameter -->
        <wcf:paramLink
          page="/customer.jsp"
          target="_blank"
          paramName="CUSTOMERID"
          sqlValue="${result.customerId}">
          click here!!
        </wcf:paramLink>
        ...
        <!-- multiple parameters -->
        <wcf:paramLink page="/customer.jsp">
          click here!!
          <wcf:linkParam
            paramName="CUSTOMERID"
            sqlValue="${result.customerId}"/>
          <wcf:linkParam
            paramName="PRODUCTID"
            sqlValue="${result.productId}"/>
        </wcf:paramLink>

        ...
      </paramLinkGroup>
    

paramLinkGroup

Body ContentJSP
Description groups a set of paramLink tags. When the start tag is executed, the links generated on previous pages are invalidated.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
hideIffalseStringtrue EL expression. If the EL returns true, no links will be rendererd.

Example

<wcf:paramLinkGroup id="mylinks"...>
  <wcf:paramLink .../>
  <wcf:paramLink .../>
</wcf:paramLinkGroup/>
    

Example

<wcf:paramLinkGroup id="mylinks" hideIf="#{mybean.printMode}">
  <wcf:paramLink .../>
  <wcf:paramLink .../>
</wcf:paramLinkGroup/>
    

paramPool

Body ContentJSP
Description ensures the SessionParamPool exists in the session with id="paramPool". Similar to jsp:useBean

AttributeRequiredTypertexprDescription

Example

<wcf:paramPool/>
    

paramSql

Body ContentJSP
Description outputs SQL syntax for the named session parameter. May contain nested paramSqlMapping tags

AttributeRequiredTypertexprDescription
paramfalseStringtrue Name of the SessionParam
qnamefalseStringtrue qualified name of the default column. This is used if parameter expression does not contain its own column id's

Example

      <wcf:paramLink
        page="/customer.jsp"
        name="CUSTOMERID"
        sqlValue="${result.customerId}">
        click here!!
      </wcf:paramLink>
      ...
      <sql:query>
        SELECT ...
        FROM CUSTOMERS T1, ...
        WHERE <wcf:paramSql param="CUSTOMERID" qname="T1.CUSTOMER_PK"/>
        AND ...
      </sql:query>
    

paramSqlMapping

Body ContentJSP
Description Maps column IDs from SQL Expressions to column alias names. For example, if a SQL Parameter contains the expression CUSTOMERID = 123 AND PRODUCTID = 'ABC', then in a concrete SQL you may want to generate T1.CUSTOMER_PK = 123 AND T2.PRODUCT_FK = 'ABC'". You can do this by mapping CUSTOMERID to T1.CUSTOMER_PK and PRODUCTID to T2.PRODUCT_FK.

Complex conditions that need mappings usually are created by application code.

AttributeRequiredTypertexprDescription
columntrueStringtrue name of the column in the SQL expression
qnametrueStringtrue qualified name in the generated SQL

Example

      <sql:query>
        SELECT ...
        FROM CUSTOMERS T1, LINE_ITEMS T2, ...
        WHERE
          <wcf:paramSql param="COMPLEX_CONDITION">
            <wcf:paramSqlMapping column="CUSTOMERID" qname="T1.CUSTOMER_PK"/>
            <wcf:paramSqlMapping column="PRODUCTID" qname="T2.PRODUTCT_FK"/>
          </wcf:paramSql>
        AND ...
      </sql:query>
    

pushbutton

Body Contentempty
Description A toolbar button with builtin boolean property pressed that reflects its state.

AttributeRequiredTypertexprDescription
idtrueStringtrue ID of the button. The button may be accessed in EL as TOOLBAR_ID.buttons.BUTTON_ID
imgtrueStringtrue Name of the image to use. The generated URLs are APPCONTEXT/wcf/toolbar/IMG-up.png and APPCONTEXT/wcf/toolbar/IMG-down.png
radioGroupfalseStringtrue Name of a radio group. At most one button of a group may be pressed.
tooltipfalseStringtrue name of the tooltip in the toolbars ResourceBundle
visibleReffalseStringtrue Either true, false or an EL expression that evaluates to a boolean property. The button will be visible only, if that property is true
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
pressedfalseStringtrue inital state

Example

<wcf:toolbar id="toolbar01" bundle="com.tonbeller.wcf.toolbar.resources">
  <wcf:pushbutton id="button4" img="button"/>
  ...
</wcf:toolbar>
...
<c:if test="${toolbar01.buttons.button4.pressed">
  <h1>Button Pressed!!</h1>
</c:if>

pushParam

Body ContentJSP
Description replaces the attributes of a session parameter when the start tag is processed and restores it when the end tag is processed.

AttributeRequiredTypertexprDescription
paramNametrueStringtrue Name of the SessionParam
displayNamefalseStringtrue visible name of the SessionParam
displayValuefalseStringtrue visible value of the SessionParam
sqlValuefalseStringtrue SQL value of the SessionParam
mdxValuefalseStringtrue MDX value of the SessionParam
textValuefalseStringtrue Text constant as value of the SessionParam

Example

      CUSTOMER_ID = 999
      <wcf:pushParam name="CUSTOMER_ID" value="#{bean.myProperty}">
        render page as if CUSTOMER_ID was bean.getMyProperty()
      </wcf:pushParam>
      now is back to CUSTOMER_ID = 999
    

render

Body ContentJSP
Description WCF components produce XML Documents (DOM) internally which is transformed via XSLT into the outputformat by this tag. The output format will be HTML most of the time, but may be any other text format like CSV for example.

The render tag will not produce any output for components that are not visible.

The body may contain renderParam tags that supply parameters for rendering. The following stylesheet parameters are provided automatically (w/o nested parameter tag):
  • renderId - contains the id of this tag. If not set the modelReference is taken
  • context - the context path of the application for building URLs
Parameters may occur in xsl (via standard <xsl:param .. >) and in the DOM. The render tag searches for <param name=".."/> elements in the DOM and creates a corresponding attribute in its parent. For example, the following DOM
      <myelem>
        <param name="abc" attr="bcd"/>
      </myelem>
      
it will become
      <myelem bcd="efg">
        <param name="abc" attr="bcd"/>
      </myelem>
      
where efg is the value of the abc parameter that was supplied by the JSP author. If the parameter named abc does not exsist, the attribute bcd is removed.

This may be used to configure the page flow from a jsp, e.g.
        <button label="OK" action="validate" handler="...">
          <param name="successPage" attr="forward"/>
        </button>
      
will create a forward attribute to the button element whose value is supplied by the jsp author via the renderParam tag, e.g.
        <wcf:renderParam name="successPage" value="/somepage.jsp"/>
      

AttributeRequiredTypertexprDescription
idfalseStringtrue der renderId Stylesheet Parameter
reftrueComponenttrue Name of the Session Attribute that contains the Component to be rendered.
xslUritrueStringtrue Path of the XSLT stylesheet to use, relative to the application context. There may be different stylesheets for different Locales, the stylesheet will be choosen upon similar rules to ResourceBundle.

Example: xslUri="/WEB-INF/mystyle.xsl". For a german Browser WCF will try to load /WEB-INF/mystyle_de.xsl. If this fails, it will load /WEB-INF/mystyle.xsl.
xslCachefalsebooleantrue true, if the stylesheet shall be compiled once and then reused. This gives better performance but makes it difficult to develop the stylesheets. Use true for production and false for development

Example

<wcf:tree id="tree01"/>
<wcf:render ref="#{tree01}" xslUri="/WEB-INF/wcf/wcf.xsl" xslCache="true">
  <wcf:renderParam name="border" value="1"/>
</wcf:render>
    

renderParam

Body Contenttagdependent
Description Adds an XSL parameter for the the render tag. If used inside a render tag, the parameter is local to that transformation. Otherwise the scope attribute specifies the scope of the parameter.

The value may be provided as literal, or as expression (starting with "#{").

Exactly one of the attributes name or test must be set.

AttributeRequiredTypertexprDescription
namefalseStringtrue Name of the parameter
valuefalseStringtrue Value of the parameter. If value starts with '#{' its interpreted as EL expression, otherwise its taken literally
scopefalseStringtrue The scope of the parameter, one of 'request' (default), 'session', 'application'.
testfalseStringtrue if present, the tag evaluates its body only if the parameter is set

Example

<wcf:renderParam name="language" value="en" scope="session"/>
<wcf:render ...>
  <wcf:renderParam name="border" value="0"/>
</wcf:render>
<wcf:renderParam test="language" value="en">
  This is english.
</wcf:renderParam>
<wcf:renderParam test="language" value="!en">
  This is not english.
</wcf:renderParam>
    

scriptbutton

Body Contentempty
Description A toolbar button that is bound to a boolean bean property

AttributeRequiredTypertexprDescription
idtrueStringtrue ID of the button. The button may be accessed in EL as TOOLBAR_ID.buttons.BUTTON_ID
imgtrueStringtrue Name of the image to use. The generated URLs are APPCONTEXT/wcf/toolbar/IMG-up.png and APPCONTEXT/wcf/toolbar/IMG-down.png
radioGroupfalseStringtrue Name of a radio group. At most one button of a group may be pressed.
tooltipfalseStringtrue name of the tooltip in the toolbars ResourceBundle
visibleReffalseStringtrue Either true, false or an EL expression that evaluates to a boolean property. The button will be visible only, if that property is true
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
modeltrueStringtrue EL expression that evaluates to a boolean property

Example

<wcf:scriptbutton id="button2" img="button" model="#{toolbean.radioButton1}" radioGroup="radio1" visibleRef="#{toolbean.checkBox1}"/>

scroller

Body ContentJSP
Description Adds java script code to the page that ensures that the browser keeps the scroll position when a user is navigating

AttributeRequiredTypertexprDescription

separator

Body Contentempty
Description Adds space between toolbar buttons

AttributeRequiredTypertexprDescription
sizefalseStringtrue width in pixel
visibleReffalseStringtrue Either true, false or an EL expression that evaluates to a boolean property. The button will be visible only, if that property is true
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.

Example

<wcf:separator/>

setParam

Body ContentJSP
Description replaces the attributes of a session parameter.

AttributeRequiredTypertexprDescription
paramNametrueStringtrue Name of the SessionParam
displayNamefalseStringtrue visible name of the SessionParam
displayValuefalseStringtrue visible value of the SessionParam
sqlValuefalseStringtrue SQL value of the SessionParam
mdxValuefalseStringtrue MDX value of the SessionParam
textValuefalseStringtrue Text constant as value of the SessionParam

Example

      CUSTOMER_ID = 999
      <wcf:setParam name="CUSTOMER_ID" value="#{bean.myProperty}"/>
      now CUSTOMER_ID is bean.getMyProperty()
    

sqlTable

Body ContentJSP
Description A table that allows sorting and paging of a JSTL sql:query result. Sorting and paging are done by the database, so very large result sets are possible.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
maxRowsfalseinttrue number or rows per page
orderByfalseStringtrue Name of the column to order by
nestedOrderByfalseStringtrue Name of an additional column to order by
descendingfalsebooleantrue Initial order by direction

Example

<form action="my.jsp" method="POST">
  <wcf:sqlTable id="mytable" maxRows="200" orderBy="CUSTOMER" descending="true">
    <sql:query var="result" maxRows="${mytable.maxRows}" startRow="${mytable.startRow}">
      SELECT   ...
      FROM ...
      WHERE ...
      <wcf:sqlTableOrderBy />
    </sql:query>
    <table border="1" cellspacing="0" cellpadding="2">
      <tr>
        <th><wcf:sqlTableSortButton column="CUSTOMER"/>&nbsp;Customer</th>
        ... more column headings ...
      </tr>
      <c:forEach var="row" items="${result.rows}">
        <tr>
          <td>
            <c:out value="${row.CUSTOMER}"/>
          </td>
          ... more columns ...
        </tr>
      </c:forEach>
      <tr>
        <td colspan="7">
          <wcf:sqlTablePageNavigations result="${result}"/>
        </td>
      </tr>
    </table>
  </wcf:sqlTable>
</form>

sqlTableOrderBy

Body Contentempty
Description emits the "ORDER BY [column-name]" for the SQL query. Used inside <sql:query> tag.

AttributeRequiredTypertexprDescription

sqlTablePageNavigations

Body Contentempty
Description creates a dialog that allows the user to see different pages

AttributeRequiredTypertexprDescription
resulttrueStringtrue the sql result to scroll

sqlTableSortButton

Body Contentempty
Description creates a sort button

AttributeRequiredTypertexprDescription
columntrueStringtrue Name of the column to sort by

statusline

Body ContentJSP
Description Displays messages and errors. The body content is the default content that is displayed if there are no errors or messages to display. In case of errors a stack trace will be printed into the generated html - it will be commented out and thus not visible, but you will see it if you choose "view source" in your browser.

AttributeRequiredTypertexprDescription
formatfalseStringtrue output format: either "html" or "text" (default = "html")
clearfalsebooleantrue clears the status line after output (default = true!)

Example

<wcf:statusline/>

table

Body ContentJSP
Description Creates a table component. This component does not produce visible output directly, it must be rendered via the WCF render tag.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
validatefalsebooleantrue if set to true, then user input will be automatically verified, even if the button of another component was pressed. Both components must be part of the same HTML form element to make this work.
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
modelfalseStringtrue EL expression that resolves to a com.tonbeller.wcf.table.TableModel
selmodefalseStringtrue Row selection mode: href, single, multi or none
closablefalsebooleantrue Either true, false or an EL expression that evaluates to a boolean property. The close button will be visible only, if that property is true
editablefalsebooleantrue "true" if the user shall hide columns etc
sortablefalsebooleantrue Either true, false or an EL expression that evaluates to a boolean property. The sorting function will be activated, if that property is true
pagablefalsebooleantrue Either true, false or an EL expression that evaluates to a boolean property. The paging function will be activated, if that property is true
colHeadersfalsebooleantrue Either true, false or an EL expression that evaluates to a boolean property. Column headers will be shown, if that property is true
pagesizefalseinttrue Maximum row count which will be displayed for a single page. The paging function must be active (pagable=true)
editFormfalseStringtrue DEPRECATED - use editable. set to context relative URI the XML file describing the table properties form to allow users to hide columns

Example

<wcf:table id="t1" model="#{tmodel}" selmode="multi" closable="false" sortable="false" pageable="true" pagesize="10"/>
<wcf:render ref="#{t1}" xslUri="/WEB-INF/wcf/wcf.xsl" xslCache="true"/>
    

tablePropertiesForm

Body ContentJSP
Description Creates a table component. This component does not produce visible output directly, it must be rendered via the WCF render tag.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
validatefalsebooleantrue if set to true, then user input will be automatically verified, even if the button of another component was pressed. Both components must be part of the same HTML form element to make this work.
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
xmlUritrueStringtrue Path of an XML config file that describes the HTML form, relative to the application context. There may be different form descriptions for different Locales, the stylesheet will be choosen upon similar rules to ResourceBundle.

Example: xmlUri='/WEB-INF/myform.xml'. For a german Browser WCF will try to load /WEB-INF/myform_de.xml. If this fails, it will load /WEB-INF/myform.xml.
closablefalsebooleantrue set to true make the component closeable
tabletrueStringtrue EL expression that resolves to a <wcf:table ...>

Example

<wcf:table id="t1" model="#{tmodel}" selmode="multi" closable="false" sortable="false" pageable="true" pagesize="10"/>
<wcf:tablePropertiesForm id="t1properties" table="#{t1}"/>
...
<!-- render the table -->
<wcf:render ref="#{t1}" xslUri="/WEB-INF/wcf/wcf.xsl" xslCache="true"/>
<!-- render the properties form -->
<wcf:render ref="#{t1properties}" xslUri="/WEB-INF/wcf/wcf.xsl" xslCache="true"/>
    

token

Body ContentEMPTY
Description Creates a hidden field to synchronize the page flow. Should be used together with the TokenFilter

AttributeRequiredTypertexprDescription
clearfalsebooleantrue Instead of producing the HTML hidden field, the token is cleared and browser back button is allowed (once!)

Example

<form ...>
  <wcf:token/>
</form>
or w/o form
  <!-- allow browser back once -->
  <wcf:token clear="true"/>
    

toolbar

Body ContentJSP
Description Creates a toolbar component. Buttons are defined via nested Elements: This component does not produce visible output directly, it must be rendered via the WCF render tag.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
validatefalsebooleantrue if set to true, then user input will be automatically verified, even if the button of another component was pressed. Both components must be part of the same HTML form element to make this work.
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
bundlefalseStringtrue ResourceBundle for tooltips
globalButtonIdsfalsebooleantrue @DEPRECATED - do not use. Workaround for a bug in earlier versions that prevented multiple toolbars to have buttons with the same id @DEPRECATED - do not use. Workaround for a bug in earlier versions that prevented multiple toolbars to have buttons with the same id

Example

<wcf:toolbar id="toolbar01" bundle="com.tonbeller.wcf.toolbar.resources">
  <wcf:scriptbutton id="button1" tooltip="testlabel" img="button" model="#{toolbean.checkBox1}"/>
  <wcf:separator/>
  <wcf:scriptbutton id="button2" img="button" model="#{toolbean.radioButton1}" radioGroup="radio1" visibleRef="#{toolbean.checkBox1}"/>
  <wcf:scriptbutton id="button3" img="button" model="#{toolbean.radioButton2}" radioGroup="radio1" visibleRef="#{toolbean.checkBox1}"/>
  <wcf:separator/>
  <wcf:pushbutton id="button4" img="button" visibleRef="#{toolbean.checkBox1}"/>
  <wcf:imgbutton  id="button5" img="button" href="/some/path" visibleRef="#{toolbean.checkBox1}"/>
</wcf:toolbar>
    

tree

Body ContentEMPTY
Description Creates a tree component. This component does not produce visible output directly, it must be rendered via the WCF render tag.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
validatefalsebooleantrue if set to true, then user input will be automatically verified, even if the button of another component was pressed. Both components must be part of the same HTML form element to make this work.
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
modelfalseStringtrue EL expression that resolves to a com.tonbeller.wcf.tree.TreeModel
selectionModelfalseStringtrue EL expression that resolves to a com.tonbeller.wcf.selection.SelectionModel

Example

<wcf:tree id="tree01"/>
<wcf:render ref="#{tree01}" xslUri="/WEB-INF/wcf/wcf.xsl" xslCache="true">
  <wcf:renderParam name="border" value="1"/>
</wcf:render>
    

wizard

Body ContentJSP
Description Creates a wizard component. This component does not produce visible output directly, it must be rendered via the WCF render tag.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
validatefalsebooleantrue if set to true, then user input will be automatically verified, even if the button of another component was pressed. Both components must be part of the same HTML form element to make this work.
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.

Example

<wcf:wizard id="wizard01">
  <wcf:form .../>
  <wcf:form .../>
  <wcf:form .../>
</wcf:wizard>

<wcf:render ref="#{wizard01}" xslUri="/WEB-INF/wcf/wcf.xsl" xslCache="true"/>