HTML and CSS Reference
In-Depth Information
public void setUserProfile(UserProfile userProfile) {
this.userProfile = userProfile;
}
}
Ajax request delay
A delay attribute was added to the <f:ajax /> tag in JSF 2.2. The attribute takes an integer containing the number of
milliseconds to wait until the Ajax request is executed. This is very useful when you use Ajax with keyboard input from
the user. Rather than executing the requests immediately as the user enters a key, it waits a number of milliseconds to
see if another key is entered before executing the request. If another key is entered, prior Ajax requests are cancelled
and only the last request is executed. Listing 5-30 shows an example of Ajax requests being delayed by 1.5 seconds
after pressing a key, giving time to the user to finish typing before dispatching the request.
Listing 5-30. Delaying the Ajax Request by 1.5 Seconds
<h:inputText value="#{registrationBean.username}" >
<f:ajax event="keyup" delay="1500" render="confirmation" />
</h:inputText>
<h:outputText id="confirmation" value="#{registrationBean.confirmationMsg}" />
New XML namespaces
As you may have noticed in the previous examples, JSF 2.2 has introduced new XML namespaces. The old
namespaces started with http://java.sun.com , whereas the new namespaces start with http://xmlns.jcp.org .
The old namespaces will still work for now, but it looks like they will be removed in future versions. The new XML
namespaces are listed in Table 5-1 .
Table 5-1. New XML Namespaces for JSF Libraries
Library
Old URI
New URI
http://java.sun.com/jsf/composite
http://xmlns.jcp.org/jsf/composite
Composite Components
http://java.sun.com/jsf/core
http://xmlns.jcp.org/jsf/core
Faces Core
http://java.sun.com/jsf/html
http://xmlns.jcp.org/jsf/html
Faces HTML
http://java.sun.com/jsp/jstl/core
http://xmlns.jcp.org/jsp/jstl/core
JSTL Core
http://java.sun.com/jsp/jstl/functions http://xmlns.jcp.org/jsp/jstl/functions
JSTL Functions
http://java.sun.com/jsf/facelets
http://xmlns.jcp.org/jsf/facelets
Facelets Templating
http://java.sun.com/jsf/passthrough
http://xmlns.jcp.org/jsf/passthrough
Pass Through
Attributes
http://java.sun.com/jsf
http://xmlns.jcp.org/jsf
Pass Through
Elements
 
Search WWH ::




Custom Search