Ajax4Jsf


Standard Syntax:
     <%@ taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

XML Syntax:
     <anyxmlelement xmlns:a4j="http://richfaces.org/a4j" />

RichFaces components

Tag Library Information
Display NameAjax4Jsf
Version1.2
Short Namea4j
URIhttp://richfaces.org/a4j
 

Tag Summary
ajaxListenerThis works the same as ActionListener or ValueChangeListener, but for an AJAX container. Add the specified class as a listener for AjaxEvent (sent in case of an AJAX request for this container).
keepAliveThis tag get bean by EL expression '#{'+name+'}' and store bean instance in component tree. After restoring view state, bean is putted to request-scope attributes with name. Since, every view will be use own instance of bean for expressions '#{name....}'
jsFunctionNo Description
statusRenders area for indicating Ajax request status on the client-side. <br /> During Encoding: Creates two "span" elements with id created as clientId of this component or of target AJAX region (pointed to by the "for" property) with appended ":status.start" and ":status:stop" strings. <br /> "start" span has "display:none" style (hidden). Inside this span, renders the value of the startText/stopText properties or, if they exist, the content of "start" and "stop" facets. <br /> On performing an AJAX request, the client-side script changes the visibility of the "start" span and hides "stop". After all requests for this indicator are completed, restores "stop" and hide "start" start[style,styleClass] and stop[style,styleClass] are rendered for spans as style and class atributes, respectivetly. <br /> During Encoding: Creates two "span" or "div"(depending on 'layout' attribute) elements with id created as clientId of this component or of target AJAX region (pointed to by the "for" property) with appended ":status.start" and ":status:stop" strings. "start" element has "display:none" style (hidden). Inside this element, renders the value of the startText/stopText properties or, if they exist, the content of "start" and "stop" facets. On performing an AJAX request, the client-side script changes the visibility of the "start" element and hides "stop". After all requests for this indicator are completed, restores "stop" and hide "start" <br /> start[style,styleClass] and stop[style,styleClass] are rendered for spans as style and class atributes, respectivetly.
portletNo Description
pushPeriodically perform AJAX request to server, to simulate 'push' data.
repeatNo Description
commandButtonRenders an HTML "input" element. <br /> During Decoding: Obtains the Map from the "requestParameterMap" property of the ExternalContext. If the value in the Map for the value of the "clientId" property of the component is not null, create a javax.faces.event.ActionEvent around the component, and pass it to the queueEvent() method of the component. If the request is Ajax-performed, add its target IDs of the reRender property to the rendered areas list of the nesting AjaxContainer. <br /> During Encoding: Builds an AJAX.Submit JavaScript call for the "onclick" event. Renders the clientId of the component as the value of the "name" attribute. Renders the current value of the component as the value of the "value" attribute. If the "styleClass" attribute is specified, render its value as the value of the "class" attribute. Renders child components inside the HTML "input" element.
actionparamA combination of the functionality of two JSF tags, <f:actionListener>; and <f:param>. At the render phase, it's decoded by parent component (<h:commandLink>; or like) as usual. <br /> At the process request phase, if the parent component performs an action event, update the value specified in the "assignTo" attribute as its value. <br /> If a converter attribute is specified, use it to encode and decode the value to a string stored in the html parameter. <br />
loadScriptNo Description
outputPanelCreates an AJAX-enabled part of the page. For a normal request, render a &lt;span&gt; or &lt;div&gt; HTML element depending on the value of the "layout" attribute, "inline" or "block". (The "id" attribute will be the value of the clientId property.) For an AJAX request, the content of this element is included in the response if the value of the property, "ajaxRendered", is set to true.
loadBundleLoad a resource bundle localized for the Locale of the current view, and expose it (as a Map) in the request attributes of the current request. In difference of original f:loadBundle tag, stored in components tree and activate on ajax/non ajax responses
mediaOutputClass for create any link-type elements to user-generated resources : images, sounds, video, active objects, applets etc. Method specified in "CreateContent" attribute will put the data from Data Bean specified in "value" attribute to the OutputStream. Important: Data Bean specified in "value" must implement Serializable.
logEncode javaScript to open popup window with client-side Log information.
regionThis tag defines a part of the JSF Tree that is to be decoded on the server side during AJAX request processing
formAjax-related version of html form. Main difference with original component - all hidden fields, necessary to command links alwais rendered, not depended of rendering links on initial page.
htmlCommandLinkAjax-related version of html commandLink. Single difference with original component - all hidden fields, necessary to command links alwais rendered, not depended of rendering links on initial page.
commandLinkRenders an HTML "a" anchor element that acts like a form submit button when clicked. <br /> During Decoding: Obtains the Map from the "requestParameterMap" property of the ExternalContext. If this Map contains non null value for the "clientId" key, creates a javax.faces.event.ActionEvent around the component and passes it to the queueEvent() method of the component. If the request is Ajax-performed, adds its target IDs from the reRender property to the rendered areas list of the nesting AjaxContainer. <br /> element for decoding as described above with the parameters of the component. (PARAM_NAME and PARAM_VALUE are the names and values, respectively, of any nested UIParameter children.) The name and the value must be URLEncoded. If the "styleClass" attribute is specified, render its value as the value of the "class" attribute. Render any non-UIParameter children as normal inside of the "a" element. These will appear as the link text.
supportAdds the AJAX functionality for those UIComponent-based component that have properties for JavaScript events. During Decoding: If a request is Ajax-performed, obtains the Map from the "requestParameterMap" property of the ExternalContext. If this Map contains non null value for the "clientId" key, creates a javax.faces.event.ActionEvent around the component, passes it to the queueEvent() method of the component, and then appends it's reRender components IDs to a list of rendered areas. During Encoding. Doesn't encode as a component. Instead, it adds ValueBinding for a property of the parent component with the name as a value of its "event" property. As a result, when rendered, the parent component builds JavaScript code for submitting an AJAX request on this event. If the component has child UIParameter components, appends it's name/value as additional request parameters. If a parent component is an instance of UIInput and the ajaxType property is "input", submits the value of the input field, also. In this case, you can submit a single input field outside of UIForm.
loadStyleNo Description
pollPeriodically perform AJAX request to server, to simulate 'poll' data.
pageThis component renders a full HTML page structure. It must be the first (and only) child for the view root (JSP <f:view> tag). No HTML code can be outside of this component. It also has support for processing child components in AJAX requests, just like <a4j:region>. For a normal request, it will render the results of a <script> element with a client-side library at the page's <head>. If this component includes a "head" facet, the facet's content will also be rendered at the <head> element. For an AJAX request, only affected components in the full document structure will be rendered. Here's an example of using it in JSP (jspx version): <jsp:root xmlns:.... <f:view> <a4j:page><f:facet name="head"> ... </f:facet> <!-- page content here --> </a4j:page> </f:view></jsp:root>
includeinclude content of external view. Navigation cases in included file change only viewId of included page, and don't perform navigation in root view.
 


Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-3 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.