Blame view

samples/watermark-sample/src/main/webapp/index.xhtml 1.81 KB
bernard authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"
      xmlns:watermark="http://richfaces.org/sandbox/watermark">
<head>
    <title>Watermark sample</title>
    <style type="text/css">
        .rich-container input.watermark {
            color: #777;
        }
    </style>
</head>

<body class="rich-container">
<ui:include src="menu.xhtml"/>
<h:messages/>

<p>

</p>
<rich:messages ajaxRendered="true"/>
<h:form id="theForm">
    <a4j:poll ajaxSingle="true" interval="5000"/>
    <a4j:queue requestDelay="400" ignoreDupResponses="true"/>

    <h:outputLabel value="Watermark text" for="text"/>
    <h:inputText id="text" value="#{watermarkBean.text}" required="true">
        <a4j:support event="onchange" ajaxSingle="true" reRender="theForm"/>
    </h:inputText>
    <h:commandButton value="Submit" action="#{watermarkBean.submit}"/>
    <br/><br/>
    <h:inputText id="watermarked" value="#{watermarkBean.watermarkedInput}">
        <watermark:watermark value="#{watermarkBean.text}"/>
    </h:inputText>

    <rich:calendar id="calendar" value="#{watermarkBean.date}" enableManualInput="true" ajaxSingle="true">
    </rich:calendar>
    <watermark:watermark value="#{watermarkBean.text}" for="calendar" suffix="InputDate"/>

    <rich:comboBox>
        <watermark:watermark value="#{watermarkBean.text}" suffix="comboboxField"/>
    </rich:comboBox>

    <input id="htmlInput"/>
    <watermark:watermark value="#{watermarkBean.text}" for="htmlInput"/>
</h:form>

<div id="status"></div>
<rich:insert src="/index.xhtml" highlight="xhtml"/>

</body>
</html>