From richfaces-svn-commits at lists.jboss.org Fri Dec 18 02:05:05 2009 Content-Type: multipart/mixed; boundary="===============6798874996848528649==" MIME-Version: 1.0 From: richfaces-svn-commits at lists.jboss.org To: richfaces-svn-commits at lists.jboss.org Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r16165 - in root/docs/trunk/Component_Reference/en-US: extras and 1 other directory. Date: Fri, 18 Dec 2009 02:05:05 -0500 Message-ID: <200912180705.nBI755Rt007705@svn01.web.mwc.hst.phx2.redhat.com> --===============6798874996848528649== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: SeanRogers Date: 2009-12-18 02:05:05 -0500 (Fri, 18 Dec 2009) New Revision: 16165 Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Referenc= e-Resources-a4jloadBundle-0.xml_sample Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actio= ns.xml root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Commo= n_features.xml root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Conta= iners.xml root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Resou= rces.xml Log: Worked on Resources chapter Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Referenc= e-Actions.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Acti= ons.xml 2009-12-17 18:52:56 UTC (rev 16164) +++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Acti= ons.xml 2009-12-18 07:05:05 UTC (rev 16165) @@ -10,7 +10,19 @@ This chapter details the basic components that respond to a user action = and submit an Ajax request.
- a4j:actionParam + <a4j:actionParam> + + + + component-type: org.ajax4jsf.ActionParameter + + + + + component-class: org.ajax4jsf.component.html.HTMLActionPar= ameter + + + The <a4j:actionParam> behavior combines the fu= nctionality of the JavaServer Faces (JSF) components <f:param> and <f:actionListener>. @@ -78,11 +90,28 @@ =
a4j:ajaxListener + + + + listener-class: org.ajax4jsf.event.AjaxListener + + + + + event-class: org.ajax4jsf.event.AjaxEvent + + + + + tag-class: org.ajax4jsf.taglib.html.jsp.AjaxListenerTag + + + The <a4j:ajaxListener> component adds an actio= n listener to a parent component. It works similar to the JavaServer Faces = <f:actionListener> or <f:valueChangeLi= stener> components, except that the invocation of <= ;a4j:ajaxListener> is not canceled if validation of the Update Model phase fails. The <a4j:ajaxListener&= gt; component is guaranteed to be invoked with each Ajax response. - Baasic usage requires only the type attribute, which= defines the fully-qualified Java class name for the listener. This Java cl= ass should implement the org.ajax4jsf.event.AjaxListener interface, which is a base listener for all listeners and is capable o= f receiving Ajax events. The object from which the event originated could b= e accessed using the java.util.EventObject.getSource() method. + Basic usage requires only the type attribute, which = defines the fully-qualified Java class name for the listener. This Java cla= ss should implement the org.ajax4jsf.event.AjaxListener interface, which is a base listener for all listeners and is capable of= receiving Ajax events. The object from which the event originated could be= accessed using the java.util.EventObject.getSource() method. The <a4j:ajaxListener> component is not invoke= d for non-Ajax requests, or when the RichFaces works in the Ajax = request generates non-Ajax response mode, so the <a4= j:ajaxListener> invocation is a good indicator that an Ajax re= sponse is going to be processed. @@ -184,12 +213,37 @@ - Incomplete + The <a4j:htmlCommandLink> component functions = similarly to the standard <h:commandLink> componen= t, but addresses some of the potential issues that can occur. + + When using the standard component, hidden fields were not rendered to c= hild elements if they were deemed unnecessary, so command links relating to= content on the initial page could become broken if they were later updated= through Ajax. The <a4j:htmlCommandLink> component= addresses this by always rendering all hidden fields. +
=
<a4j:jsFunction> + + + + component-type: org.ajax4jsf.Function + + + + + component-family: org.ajax4jsf.components.ajaxFunction + + + + + component-class: org.ajax4jsf.component.html.HtmlajaxFunct= ion + + + + + renderer-type: org.ajax4jsf.components.ajaxFunctionRendere= r + + + The <a4j:jsFunction> component allows Ajax req= uests to be performed directly from JavaScript code, and server-side data t= o be invoked and returned in JavaScript Object Notation (JSON) format to use in client-side JavaScript calls. @@ -213,19 +267,75 @@ =
<a4j:poll> + + + + component-type: org.ajax4jsf.Poll + + + + + component-family: org.ajax4jsf.components.AjaxPoll + + + + + component-class: org.ajax4jsf.component.html.AjaxPoll + + + + + renderer-type: org.ajax4jsf.components.AjaxPollRenderer + + + The <a4j:poll> component allows periodical sen= ding of Ajax requests to the server. It is used for repeatedly updating a p= age at specific time intervals. - The interval attribute specifies the time in millise= conds to between requests. The default for this value is 1000 ms (1 second). + The interval attribute specifies the time in millise= conds between requests. The default for this value is 1000 ms (1 second). + + The timeout attribute defines the response waiting t= ime in milliseconds. If a response isn't received within the timeout period= , the connection is aborted and the next request is sent. By default, the t= imeout is not set. + + + The <a4j:poll> component can be enabled and di= sabled using the enabled attribute. Using Expression Lan= guage (EL), the enabled attribute can= point to a bean property to apply a particular attribute value. +
=
<a4j:push> + + + + component-type: org.ajax4jsf.Push + + + + + component-family: org.ajax4jsf.components.AjaxPush + + + + + component-class: org.ajax4jsf.component.html.AjaxPush + + + + + renderer-type: org.ajax4jsf.components.AjaxPushRenderer + + + - Incomplete + The <a4j:push> component periodically performs= an Ajax request to the server, simulating "push" functionality. While it i= s not strictly pushing updates, the request is made to minimal code only, n= ot to the JSF tree, checking for the presence of new mes= sages in the queue. The request registers EventListener, which receives messages about events, but does not poll registered bea= ns. If a message exists, a complete request is performed. This is different= from the <a4j:poll> component, which performs a f= ull request at every interval. + + The interval attribute specifies the time in millise= conds between checking for messages. The default for this value is 1000 ms = (1 second). It is possible to set the interval value to 0, in which case it is constantly checking for new messages. + + + The timeout attribute defines the response waiting t= ime in milliseconds. If a response isn't received within the timeout period= , the connection is aborted and the next request is sent. By default, the t= imeout is not set. In combination with the interval attr= ibute, checks for the queue state can short polls or long connections. +
= Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Referenc= e-Common_features.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Comm= on_features.xml 2009-12-17 18:52:56 UTC (rev 16164) +++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Comm= on_features.xml 2009-12-18 07:05:05 UTC (rev 16165) @@ -19,7 +19,7 @@
Calling available JavaScript methods - Incomplete + Client-side JavaScript methods can be called using component events. Th= ese JavaScript methods are defined using the relevant event attribute for t= he component tag.
= Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Referenc= e-Containers.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Cont= ainers.xml 2009-12-17 18:52:56 UTC (rev 16164) +++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Cont= ainers.xml 2009-12-18 07:05:05 UTC (rev 16165) @@ -7,7 +7,7 @@ Containers - Incomplete + This chapter details those components in the a4j = tag library which define an area used as a container or wrapper for other c= omponents.
<a4j:form> Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Referenc= e-Resources.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Reso= urces.xml 2009-12-17 18:52:56 UTC (rev 16164) +++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Reso= urces.xml 2009-12-18 07:05:05 UTC (rev 16165) @@ -7,38 +7,196 @@ Resources - Incomplete + This chapter covers those components used to handle and manage resources= and beans.
- a4j:loadBundle + <a4j:loadBundle> + + + + component-type: org.ajax4jsf.Bundle + + + + + component-family: org.ajax4jsf.Bundle + + + + + component-class: org.ajax4jsf.component.html.AjaxLoadBundl= e + + + - Incomplete + The <a4j:loadBundle> component is used to load= resource bundles to aid in localization of an application. The bundles are= localized to the locale of the current view, and properties are stored as = a map in the current request attributes. + + The <a4j:loadBundle> component allows bundles = to be accessed by Ajax requests working in their own address scopes. This s= olves the problem of using the JSF <h:loadBu= ndle> component with Ajax, where bundle information loaded wit= h the page was unavailable for later Ajax requests. + + + Resource bundles are registered in the Faces configuration file, faces-config.xml. + + + <sgmltag><a4j:loadBundle></sgmltag> example + + This example shows a simple application capable of switching between d= ifferent localized languages. + + + + Create resource bundles + + String resource bundles are contained in files with a .properties extension. The files consist of a li= st of entries, each with a unique name and a corresponding value. A seperat= e file is required for each language. Append the filename with the locale i= dentifier (en for English, for example). + + + + Register bundles in Faces configuration file + + The resource bundles need to be registered in the Faces configuratio= n file, faces-config.xml. The filename is defined with= the <message-bundle> tag, without the locale code= and without the extension. The supported locale codes are listed with <supported-locale> tags. + + + + + + + Create method to set locale + + The JSF javax.faces.component.UIViewR= oot.setLocale() method can be used to update the locale throug= h a Java class: + + + + + + + Add <sgmltag><a4j:loadBundle></sgmltag> to the <acronym>= JSP</acronym> page + + The <a4j:loadBundle> component is added to = the application, and links to change the locale will update the displayed t= ext. + + + + + + + + Clicking on the different links will render the localized string as ap= propriate. + +
=
- a4j:loadScript + <a4j:loadScript> + + + + component-type: org.ajax4jsf.LoadScript + + + + + component-family: org.ajax4jsf.LoadScript + + + + + component-class: org.ajax4jsf.component.html.HtmlLoadScrip= t + + + + + renderer-type: org.ajax4jsf.LoadScriptRenderer + + + - Incomplete + The <a4j:loadScript> component allows scripts = to be loaded from external sources such as jar files. + + The required src attribute defines the path to the s= cript. A leading slash (/) represents the root of the we= b context. The resource:/// prefix can be used to access a fil= e in the RichFaces resource framework. +
=
- a4j:loadStyle + <a4j:loadStyle> + + + + component-type: org.ajax4jsf.Push + + + + + component-family: org.ajax4jsf.components.AjaxPush + + + + + component-class: org.ajax4jsf.component.html.AjaxPush + + + + + renderer-type: org.ajax4jsf.components.AjaxPushRenderer + + + Incomplete
=
- a4j:keepAlive + <a4j:keepAlive> + + + + component-type: org.ajax4jsf.Push + + + + + component-family: org.ajax4jsf.components.AjaxPush + + + + + component-class: org.ajax4jsf.component.html.AjaxPush + + + + + renderer-type: org.ajax4jsf.components.AjaxPushRenderer + + + Incomplete
=
- a4j:mediaOutput + <a4j:mediaOutput> + + + + component-type: org.ajax4jsf.Push + + + + + component-family: org.ajax4jsf.components.AjaxPush + + + + + component-class: org.ajax4jsf.component.html.AjaxPush + + + + + renderer-type: org.ajax4jsf.components.AjaxPushRenderer + + + Incomplete Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Refe= rence-Resources-a4jloadBundle-0.xml_sample =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Referen= ce-Resources-a4jloadBundle-0.xml_sample (rev 0) +++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Referen= ce-Resources-a4jloadBundle-0.xml_sample 2009-12-18 07:05:05 UTC (rev 16165) @@ -0,0 +1,9 @@ + + + en + en + de + it + + demo.message + --===============6798874996848528649==--