watermark.xml 3.22 KB
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
        "http://labs.jboss.com/jbossrichfaces/component-config.dtd">

<components>
    <component>
        <name>org.richfaces.Watermark</name>
        <family>org.richfaces.Watermark</family>
        <classname>org.richfaces.component.html.HtmlWatermark</classname>
        <superclass>org.richfaces.component.UIWatermark</superclass>
        <description>
            <![CDATA[
                    Adds watermark capability to HTML input and textarea elements.
                    A watermark typically appears as light gray text within an input or textarea element whenever
                    the element is empty and does not have focus. This provides a hint to the user as to what
                    the input or textarea element is used for, or the type of input that is required.
                    ]]>
        </description>
        <renderer generate="true" override="true">
            <name>org.richfaces.component.renderkit.html.WatermarkRenderer</name>
            <template>htmlWatermark.jspx</template>
        </renderer>
        <tag>
            <name>watermark</name>
            <classname>org.richfaces.taglib.WatermarkTag</classname>
            <superclass>
                org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
            </superclass>
        </tag>
        <taghandler generate="true">
            <classname>org.richfaces.taglib.WatermarkTagHandler</classname>
            <superclass>com.sun.facelets.tag.jsf.ComponentHandler</superclass>
        </taghandler>
        &ui_output_attributes;
        <property>
            <name>styleClass</name>
            <classname>java.lang.String</classname>
            <description>Assigns one or more CSS class names to the component. Corresponds to the HTML &quot;class&quot;
                attribute.
            </description>
        </property>
        <property>
            <name>suffix</name>
            <classname>java.lang.String</classname>
            <description>
                Use this if watermark should be attached to element with id different then component id.
                i.e.: rich:comboBox with id="combo" nested in form with id="f" renders input with
                clientId="f:combocomboboxField"
                So in order to attach watermark to that element provide suffix="comboboxField".
            </description>
        </property>
        <property>
            <name>for</name>
            <classname>java.lang.String</classname>
            <description>
                Use this if watermark cannot be nested within come components i.e. in calendar.

                Example 1: rich:calendar with id="c" nested in form with id="f" renders input with
                clientId="f:cInputDate".
                rich:calendar also gets messed up if watermark is nested within, so place it outside of calendar.
                So in order to attach watermark to that element provide for="c" suffix="InputDate".

                Example 2: watermark should be attached to pure html input (not jsf component) with id="htmlInput".
                To achieve this provide for="htmlInput".
            </description>
        </property>
    </component>
</components>