focusManager

Table of Contents

Overview

Since 4.0

You can use the icecore:focusManager tag to manage where focus will be applied on page load.

See the ICEfaces Showcase Live Demo of this component, complete with source code.

The focus manager provides the following automatic focus setting features when it is included inside a form component:

  • The first visible (enabled) input element in the form has focus set on it initially.
  • Alternatively, if there is an invalid component in the form (failed validation), the first visible (enabled) invalid component will receive focus instead.
  • The application also can specify a component to have focus set on it via the "for" attribute.

Getting Started

To use the icecore:focusManager tag, first declare the core namespace:

<html ... xmlns:icecore="http://www.icefaces.org/icefaces/core">

Then add the tag to your page enclosing the components that you want to have the focus managed:

<h:body> 
    ... 
    <icecore:focusManager>
        ....
        <h:form>
            <h:inputText .../>
            <h:inputText .../>
            ....
            ....
           <ace:autoCompleteEntry ..../>
        </h:form>
        ....
    </icecore:focusManager>
    ... 
</h:body>

Example using the "for" attribute:

<h:form id="form"> 
    ... 
    <icecore:focusManager for="A">
        <h:inputText .../>
        <h:inputText id="A" .../>
        ....
        ....
        <ace:autoCompleteEntry ..../>
    </icecore:focusManager>
    ... 
</h:form>

Attributes

TagLib Documentation
This section covers attributes involved in the typical use-cases for this component. For reference, the complete taglib documentation for this component is available here.

for Use this attribute to specify the ID of the component that will receive focus.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2018 ICEsoft Technologies Canada Corp.