Blame view

samples/focus-sample/src/main/webapp/focus_3.xhtml 1.2 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
<!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:focus="http://richfaces.org/sandbox/focus" xmlns:rich="http://richfaces.org/rich"
        >
<head>
    <title>Focus sample</title>
</head>
<body>
<ui:include src="menu.xhtml"/>

<p>Focus should be placed on username :
    <ul>
        <li>username gets default priority 0</li>
        <li>email gets priority 1</li>
    </ul>
</p>
<h:form>
    <h:panelGrid columns="3">
        <h:outputLabel value="Username" for="username"/>
        <h:inputText value="#{username}" id="username" required="true">
            <focus:focus/>
        </h:inputText>
        <h:message for="username"/>

        <h:outputLabel value="Email" for="email"/>
        <h:inputText value="#{email}" id="email" required="true"/>
        <h:message for="email"/>
    </h:panelGrid>
    <h:commandButton value="Submit"/>
    <focus:focus for="email"/>
</h:form>

<rich:insert src="/focus_3.xhtml" highlight="html"/>

</body>
</html>