blob: 1a2a74ab0a2642b03b67bca7d028b2a348fb8c0e [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<ui:composition template="/main.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:param name="title" value="Focus"/>
<p>
After a page is loaded, some input element may have the focus, so the user
can immediately begin typing information in the form. There is a ruleset to define
which element have the focus, at first.
</p>
<p>
The boolean focus attribute of an input field sets the focus to the element explicitly.
</p>
<p>
The priority order is:
</p>
<ul>
<li>error (the first error element gets the focus)</li>
<li>auto (the element with the tobago tag attribute focus="true" gets the focus)</li>
<li>last (the element from the last request with same id gets the focus, not AJAX)</li>
<li>page (use the focusId attribute of the tc:page)</li>
<li>first (the first input element (without tabindex=-1) gets the focus, not AJAX)</li>
</ul>
</ui:composition>