Blame view

samples/notify-sample/src/main/webapp/notify.xhtml 3.09 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
<!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">
        .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>
    Here we have notify displaying all messages (not only global).
    Severity is reflected in overriden style classes.
</p>
<h:form>
    <notify:notify sticky="false" stayTime="5000"
                   title="Default stack"
                   text="Details of the message"
                   nonblockingOpacity="0"/>
    <notify:notify title="Before stack definition"
                   text="This message is defined in code before stack"
                   stack="bottomLeftStack"/>
    <notify:notify title="Left bottom stack 2"
                   text="This message alos should be displayed in the left bottom corner"
                   showCloseButton="true" stack="bottomLeftStack"/>
    <notify:notifyStack id="bottomLeftStack" styleClass="bottomLeft" stackDir1="up"
                        stackDir2="right" push="top">
        <notify:notify sticky="true"
                       title="Left bottom stack"
                       text="This message should be displayed in the left bottom corner
                               and should stay until you close it"
                       showCloseButton="true"/>
        <notify:notify title="Nonblocking"
                       nonblocking="true"/>
    </notify:notifyStack>
    <notify:notifyMessages interval="1000" stack="bottomRightStack" ajaxRendered="true"/>
    <notify:notifyStack id="bottomRightStack" styleClass="bottomRight" stackDir1="up"
                        stackDir2="left" push="bottom"/>
    Leave this blank for error:
    <br/>
    <h:outputLabel for="greeting" value="Greeting"/>
    <h:inputText id="greeting" value="#{greeter.greeting}" required="true"/>* <h:message for="greeting"/>
    <br/>
    <h:outputLabel for="surname" value="Surname"/>
    <h:inputText id="surname" required="true">
        <f:validateLongRange minimum="5" maximum="10"/>
    </h:inputText>* <h:message for="surname"/>
    <br/>
    <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:form>

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

</body>
</html>