Auto Focus on particular element on page load in JSF

Inside <f:view> place the following scriplet..

<%
javax.faces.context.FacesContext.getCurrentInstance()
.getViewRoot().setLocale(request.getLocale());
%>

-------------------------------------------------------------
Above </h:form> plce the following code...
The target filed (XXXX) indicates which field should have focus on page load

<hx:inputHelperSetFocus id="setFocus1" target="XXXX"
rendered="true"></hx:inputHelperSetFocus>


1 comments:

Peter said...

This does not help at, first of all, why should it be nescessary to set locale to be able to set focus??? And where does hx: come from? Please provide a little bit better examples....