cdk


XML Syntax:
     <anyxmlelement xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core" />

RichFaces CDK core tags and attributes.

Summary
@* Global attributes of http://jboss.org/schema/richfaces/cdk/core namespace
body

Template body marker tag. Should be used only once in template document. Component renderers in JSF define three methods for content rendering, so the following rules are applied for <cc:implementation> part of template document:

  • all content declared before <cdk:body> tag is compiled into statements of encodeBegin(...) method
  • all content declared inside <cdk:body> tag is compiled into statements of encodeChildren(...) method. If content of body element is empty, no encodeChildren(...) method will be generated unless 'enforce' attribute set to true.
  • all content declared after <cdk:body> tag is compiled into statements of encodeEnd(...) method
If there are no compiled statements for one of the aforementioned methods, then definition for this method is not created in the generated file.
If template document doesn't declare <cdk:body> tag, then contents of <cc:implementation> part is compiled into statements of encodeEnd(...) method.

Examples:

The following code snippet:

 ... <cc:implementation> <div id="myId"> <cdk:body> <span>Component content</span> </cdk:body> </div> </cc:implementation> ... 
produces the following code (unsignificant details are ommitted):
 ... encodeBegin(...) { ... writer.startElement("div", cc); writer.writeAttribute("id", "myId", null); } encodeChildren(...) { ... writer.startElement("span", cc); writer.writeText("Component content", null); writer.endlement("span"); } encodeEnd(...) { ... writer.endElement("div"); } ... 


The following code snippet:
 ... <cc:implementation> <div id="myId"> <cdk:body /> </div> </cc:implementation> ... 
produces the following code (unsignificant details are ommitted):
 ... encodeBegin(...) { ... writer.startElement("div", cc); writer.writeAttribute("id", "myId", null); } encodeEnd(...) { ... writer.endElement("div"); } ... 


If you want to disable default encodeChildren method, use enforce attribute:
 ... <cc:implementation> <div id="myId"> <cdk:body enforce="true"/> </div> </cc:implementation> ... 
produces the following code (unsignificant details are ommitted):
 ... encodeBegin(...) { ... writer.startElement("div", cc); writer.writeAttribute("id", "myId", null); } encodeChildren(...) { // empty method. } encodeEnd(...) { ... writer.endElement("div"); } ... 


The following code snippet:
 ... <cc:implementation> <div id="myId"> Some text </div> </cc:implementation> ... 
produces the following code (unsignificant details are ommitted):
 ... encodeEnd(...) { ... writer.startElement("div", cc); writer.writeText("Some text", null); writer.endElement("div"); } ... 

call

Arbitrary method invocation statement. Should be used within cc:implementation element.

Note: method return value is ignored.

caseNo Description
class

Fully-qualified name of the generated renderer class.

Should be used within cc:interface element.

component-family

Family of the component to be rendered by this renderer.

Should be used within cc:interface element.

defaultNo Description
import

Part of <composite:interface> section to specify additional Java imports.

Examples:

  • <cdk:import package="javax.faces.component" names="UIInput UIOutput" />
  • <cdk:import package="java.util" names="*" />
  • <cdk:import package="java.lang" names="String.valueOf" static="true" />

import-attributes

Defines fragment of faces configuration file to import attributes from.

Should be used within cc:interface element.

object

Introduces new variable. Variable's scope is limited to the context of the current method, i.e. variables defined before <cdk:body> are not available after it.

Should be used within cc:implementation element.

Usage example:

  • <cdk:object name="children" type="List" type-arguments="UIComponent" value="#{cc.children}" />

renderer-type

Renderer type identifier for this renderer.

Should be used within cc:interface element.

renderkit-id

ID of the renderkit to include this renderer to. Defaults to 'HTML_BASIC'.

Should be used within cc:interface element.

renders-children

Indicating whether generated renderer is responsible for rendering the children of the component it is asked to render.

Should be used within cc:interface element.

resource-dependencies

Container tag to specify multiple <resource-dependency> tags on a single class.

Should be used within cc:interface element.

resource-dependencyNo Description
root

Root template tag containing cc:interface & cc:implementation tags.

scriptObject

Handy tag for JavaScript hash objects creation. NB: default and empty values are not added to the result hash.

Example usage:

<cdk:scriptObject name="myHash"> <cdk:scriptOption name="showSomething" value="#{isShowSomething(component)}" /> ... </cdk:scriptObject> <script ...> new Component(#{toScriptArgs(clientId, myHash)});

scriptOption

Represents single object in the JavaScript hash. Should be enclosed into <cdk:scriptObject> tag.

superclass

Fully-qualified name of the renderer superclass.

Should be used within cc:interface element.

switchNo Description
 


Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-3 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.