RichFaces allows us to render partial tree processing by using RichFaces attributes. The execute attribute is used to specify that which part of the JSF tree to process during an Ajax request. The execute attribute can point to an id identifier of a specific component to process. Components can also be identified through the use of Expression Language (EL).
The execute attribute accepts the following keywords:
Keyword | Function |
---|---|
@all | It is used to processed every component. |
@none | It is used to set that no components are processed. |
@this | It is used to process the requesting component with the execute attribute. |
@form | It is used to process the form that contains the requesting component. |
@region | It is used to process the region that contains the requesting component. You should use the <a4j:region> component as a wrapper element to specific regions. |
Partial Tree Processing Example
// index.xhtml
<!DOCTYPE html> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <h:form id="form"> <h:outputText value="User Name " /> <h:inputText value="#{user.name}" /> <a4j:commandButton value="Enter Your Name" execute="@form" /> </h:form> <br/> <a4j:outputPanel> <h:outputText value="Hello #{user.name} !" rendered="#{not empty user.name}" /> </a4j:outputPanel> </ui:composition>
Next Topic:-Click Here