Blame view

samples/notify-sample/src/main/webapp/notify_1.xhtml 11.3 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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
<!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:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:notify="http://richfaces.org/sandbox/notify"
        >
<head>
    <title>Notify sample</title>
    <style type="text/css">
        .black .rf-ny-co {
            background: #000;
            color: #fff;
        }

        .mail .rf-ny-co {
            padding: 0 10px;
        }

        .mail .rf-ny-cl {
            margin-top: 4px;
        }

        .mail .rf-ny-ic {
            display: block;
            background-image: url(mail.png);
            background-position: 50% 50%;
            background-repeat: no-repeat;
            width: 18px;
            height: 20px;
        }

        .topLeft {
            bottom: auto;
            left: 10px;
            top: 10px;
            right: auto;
        }

        .topRight {
            bottom: auto;
            right: 10px;
            top: 10px;
            left: auto;
        }

        .bottomLeft {
            bottom: 10px;
            left: 10px;
            top: auto;
            right: auto;
        }

        .bottomRight {
            bottom: 10px;
            right: 10px;
            top: auto;
            left: auto;
        }
    </style>
</head>
<body class="rich-container">
<ui:include src="menu.xhtml"/>

<p>
    Some attributes require propper combination.
    stackDirHorizontal:right,styleClass:bottom
</p>
<h:form>
    <a4j:outputPanel ajaxRendered="true">
        <notify:notifyStack id="customStack"
                            stackDir1="#{greeter.stackDir1}"
                            stackDir2="#{greeter.stackDir2}"
                            push="#{greeter.stackPush}"
                            styleClass="#{greeter.stackStyleClass}"
                />
        <notify:notify title="#{greeter.title}"
                       text="#{greeter.text}"
                       nonblocking="#{greeter.nonblocking}"
                       showShadow="#{greeter.showShadow}"
                       showHistory="#{greeter.showHistory}"
                       showCloseButton="#{greeter.showCloseButton}"
                       sticky="#{greeter.sticky}"
                       stayTime="#{greeter.stayTime}"
                       appearAnimation="#{greeter.appearAnimation}"
                       hideAnimation="#{greeter.hideAnimation}"
                       animationSpeed="#{greeter.animationSpeed}"
                       nonblockingOpacity="#{greeter.nonblockingOpacity}"
                       styleClass="#{greeter.styleClass}"
                       stackDir1="#{greeter.stackDir1}"
                       stackDir2="#{greeter.stackDir2}"
                       stackPush="#{greeter.stackPush}"
                       stack="customStack"
                />
    </a4j:outputPanel>
    <notify:notifyMessages interval="#{greeter.interval}"
                           nonblocking="#{greeter.nonblocking}"
                           showShadow="#{greeter.showShadow}"
                           showHistory="#{greeter.showHistory}"
                           showCloseButton="#{greeter.showCloseButton}"
                           sticky="#{greeter.sticky}"
                           stayTime="#{greeter.stayTime}"
                           appearAnimation="#{greeter.appearAnimation}"
                           hideAnimation="#{greeter.hideAnimation}"
                           animationSpeed="#{greeter.animationSpeed}"
                           nonblockingOpacity="#{greeter.nonblockingOpacity}"
                           styleClass="#{greeter.styleClass}"
                           stackDir1="#{greeter.stackDir1}"
                           stackDir2="#{greeter.stackDir2}"
                           stackPush="#{greeter.stackPush}"
                           stack="customStack"/>
    <a4j:commandButton value="Say Hello" action="#{greeter.sayHello}"/>
    <a4j:commandButton value="Warn me" action="#{greeter.warnMe}"/>
    <a4j:commandButton value="Say error" action="#{greeter.sayError}"/>
    <a4j:commandButton value="Say fatal" action="#{greeter.sayFatal}"/>
    <h:panelGrid columns="2">
        <rich:panel>
            <f:facet name="header">Common</f:facet>
            <h:panelGrid columns="2">
                <h:outputLabel value="Nonblocking" for="nonblocking"/>
                <h:selectBooleanCheckbox value="#{greeter.nonblocking}" id="nonblocking"/>
                <h:outputLabel value="Show detail" for="showDetail"/>
                <h:selectBooleanCheckbox value="#{greeter.showDetail}" id="showDetail"/>
                <h:outputLabel value="Show summary" for="showSummary"/>
                <h:selectBooleanCheckbox value="#{greeter.showSummary}" id="showSummary"/>
                <h:outputLabel value="Sticky" for="sticky"/>
                <h:selectBooleanCheckbox value="#{greeter.sticky}" id="sticky"/>
                <h:outputLabel value="Show history" for="showHistory"/>
                <h:selectBooleanCheckbox value="#{greeter.showHistory}" id="showHistory"/>
                <h:outputLabel value="Show shadow" for="showShadow"/>
                <h:selectBooleanCheckbox value="#{greeter.showShadow}" id="showShadow"/>
                <h:outputLabel value="Show close button" for="showCloseButton"/>
                <h:panelGroup>
                    <h:selectBooleanCheckbox value="#{greeter.showCloseButton}" id="showCloseButton"/>
                    Applicable only with nonblocking set to false.
                </h:panelGroup>
                <h:outputLabel value="Stay time" for="stayTime"/>
                <h:inputText value="#{greeter.stayTime}" id="stayTime"/>
                <h:outputLabel value="Delay" for="delay"/>
                <h:inputText value="#{greeter.delay}" id="delay"/>
                <h:outputLabel value="Nonblocking opacity" for="nonblockingOpacity"/>
                <h:inputText value="#{greeter.nonblockingOpacity}" id="nonblockingOpacity"/>
                <h:outputLabel value="Animation speed" for="animationSpeed"/>
                <h:inputText value="#{greeter.animationSpeed}" id="animationSpeed"/>
                <h:outputLabel value="Style class" for="styleClass"/>
                <h:selectOneListbox value="#{greeter.styleClass}" id="styleClass" size="1">
                    <f:selectItem itemValue="" itemLabel="(none)"/>
                    <f:selectItem itemValue="mail" itemLabel="mail"/>
                    <f:selectItem itemValue="rf-ny-error" itemLabel="rf-ny-error"/>
                    <f:selectItem itemValue="black" itemLabel="black"/>
                </h:selectOneListbox>
                <h:outputLabel value="Appear animation" for="appearAnimation"/>
                <h:selectOneListbox value="#{greeter.appearAnimation}" id="appearAnimation" size="1">
                    <f:selectItem itemValue="none" itemLabel="none"/>
                    <f:selectItem itemValue="show" itemLabel="show"/>
                    <f:selectItem itemValue="fade" itemLabel="fade"/>
                    <f:selectItem itemValue="slide" itemLabel="slide"/>
                </h:selectOneListbox>
                <h:outputLabel value="Hide animation" for="hideAnimation"/>
                <h:selectOneListbox value="#{greeter.hideAnimation}" id="hideAnimation" size="1">
                    <f:selectItem itemValue="none" itemLabel="none"/>
                    <f:selectItem itemValue="show" itemLabel="show"/>
                    <f:selectItem itemValue="fade" itemLabel="fade"/>
                    <f:selectItem itemValue="slide" itemLabel="slide"/>
                </h:selectOneListbox>
            </h:panelGrid>
        </rich:panel>
        <h:panelGroup>
            <rich:panel>
                <f:facet name="header">Notify</f:facet>
                <h:panelGrid columns="2">
                    <h:outputLabel value="title" for="title"/>
                    <h:inputText value="#{greeter.title}" id="title"/>
                    <h:outputLabel value="text" for="text"/>
                    <h:inputText value="#{greeter.text}" id="text"/>
                </h:panelGrid>
            </rich:panel>
            <rich:panel>
                <f:facet name="header">NotifyMessages</f:facet>
                <h:panelGrid columns="2">
                    <h:outputLabel value="Interval" for="interval"/>
                    <h:inputText value="#{greeter.interval}" id="interval"/>
                </h:panelGrid>
            </rich:panel>
            <rich:panel>
                <f:facet name="header">Stack</f:facet>
                <h:panelGrid columns="2">
                    <h:outputLabel value="Stacking direction 1" for="stackDir1"/>
                    <h:selectOneRadio value="#{greeter.stackDir1}" id="stackDir1" size="1">
                        <f:selectItem itemValue="up" itemLabel="up"/>
                        <f:selectItem itemValue="down" itemLabel="down"/>
                        <f:selectItem itemValue="left" itemLabel="left"/>
                        <f:selectItem itemValue="right" itemLabel="right"/>
                    </h:selectOneRadio>
                    <h:outputLabel value="Stacking direction 2" for="stackDir2"/>
                    <h:selectOneRadio value="#{greeter.stackDir2}" id="stackDir2" size="1">
                        <f:selectItem itemValue="up" itemLabel="up"/>
                        <f:selectItem itemValue="down" itemLabel="down"/>
                        <f:selectItem itemValue="left" itemLabel="left"/>
                        <f:selectItem itemValue="right" itemLabel="right"/>
                    </h:selectOneRadio>
                    <h:outputLabel value="Stack push" for="stackPush"/>
                    <h:selectOneRadio value="#{greeter.stackPush}" id="stackPush" size="1">
                        <f:selectItem itemValue="top" itemLabel="top"/>
                        <f:selectItem itemValue="bottom" itemLabel="bottom"/>
                    </h:selectOneRadio>
                    <h:outputLabel value="Stack position" for="stackStyleClass"/>
                    <h:selectOneListbox value="#{greeter.stackStyleClass}" id="stackStyleClass" size="1">
                        <f:selectItem itemValue="topLeft" itemLabel="topLeft"/>
                        <f:selectItem itemValue="topRight" itemLabel="topRight"/>
                        <f:selectItem itemValue="bottomLeft" itemLabel="bottomLeft"/>
                        <f:selectItem itemValue="bottomRight" itemLabel="bottomRight"/>
                    </h:selectOneListbox>
                    <ul>Good combinations are :
                        <li>right,down,bottom,topLeft</li>
                        <li>left,down,bottom,topRight</li>
                        <li>right,up,bottom,bottomLeft</li>
                        <li>left,up,bottom,bottomRight</li>
                    </ul>
                </h:panelGrid>
                Changing stack attributes is bad if messages are added
                in ajax mode, because current widget implementation
                does not allow to refresh messages styleClass that should be
                borrowed from stack (this is done on server side)
            </rich:panel>
        </h:panelGroup>
    </h:panelGrid>
</h:form>

<rich:insert src="/notify_1.xhtml" highlight="xhtml" rendered="#{showSource!=false}"/>
</body>
</html>