focus_2.xhtml
2 KB
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
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition 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:sand="http://richfaces.org/sandbox"
                xmlns:a4j="http://richfaces.org/a4j" 
                xmlns:rich="http://richfaces.org/rich"
                template="./../../template.xhtml">
    <ui:define name="htmlHead">
        <title>Focus sample</title>
    </ui:define>
    <ui:define name="header">
        <ui:include src="menu.xhtml"/>
    </ui:define>
    <ui:define name="content">
        <p>Focus should be placed on first radio :
            <ul>
                <li>username gets priority 9999</li>
                <li>email gets default 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">
                    <sand:focus priority="9999"/>
                </h:inputText>
                <h:message for="username"/>
                <h:outputLabel value="Option" for="option"/>
                <h:selectOneRadio value="#{option}" id="option" required="true">
                    <f:selectItem itemLabel="Option 1" itemValue="1"/>
                    <f:selectItem itemLabel="Option 2" itemValue="2"/>
                    <f:selectItem itemLabel="Option 3" itemValue="3"/>
                    <sand:focus suffix=":0"/>
                </h:selectOneRadio>
                <h:message for="option"/>
            </h:panelGrid>
            <h:commandButton value="Submit"/>
        </h:form>
        <rich:insert src="#{request.contextPath}/pages/focus/focus_2.xhtml" highlight="html"/>
    </ui:define>
</ui:composition>