tags:

views:

34

answers:

1

I'm looking for a way to set focus to an ICEfaces component by means of an anchor tag. For instance, when a field fails validation I want to output something like this:

<a href="#xyz"> Field XYZ</a>  failed validation

and then, at the XYZ component, have something like:

<ice:inputText id="XYZ" anchor="xyz">

This would enable the user to click on the error message and get focus on the offending component. Is this in any way possible? (I'm aware of the outputLink and inputLink component, but the error message would typically reside in a message.properties file making it hard to use components...)

I'm using ICEfaces version 1.8.2

A: 

Use labels. There they are for.

<h:outputLabel for="xyz">message</h:outputLabel>
<h:inputText id="xyz" />

Substitute with ice variants if necessary.

BalusC