From ajax4jsf-svn-commits at lists.jboss.org Thu Jun 28 10:20:53 2007 Content-Type: multipart/mixed; boundary="===============5763949250218360228==" MIME-Version: 1.0 From: ajax4jsf-svn-commits at lists.jboss.org To: ajax4jsf-svn-commits at lists.jboss.org Subject: [ajax4jsf-svn-commits] JBoss Ajax4JSF SVN: r291 - trunk/docs/userguide/en/src/main/docbook/modules. Date: Thu, 28 Jun 2007 10:19:13 -0400 Message-ID: --===============5763949250218360228== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: vkorluzhenko Date: 2007-06-28 10:19:13 -0400 (Thu, 28 Jun 2007) New Revision: 291 Modified: trunk/docs/userguide/en/src/main/docbook/modules/a4jUGfaq.xml Log: Create meaningful questions from subtitles in FAQ chapter Modified: trunk/docs/userguide/en/src/main/docbook/modules/a4jUGfaq.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 --- trunk/docs/userguide/en/src/main/docbook/modules/a4jUGfaq.xml 2007-06-2= 8 11:34:21 UTC (rev 290) +++ trunk/docs/userguide/en/src/main/docbook/modules/a4jUGfaq.xml 2007-06-2= 8 14:19:13 UTC (rev 291) @@ -1,188 +1,169 @@
- = - - - RENDER_RESPONSE + + + + RENDER_RESPONSE = - onComplete + onComplete = - keepAlive - requestDelay - - - FAQ -
- - What should I change on the server side - - As it was mentioned before, the list of zones to be reRendered can be specified - as EL expression. But there is a question that must be specifi= ed more exactly. = + keepAlive + requestDelay + + + FAQ +
+ + What should I change on the server side? + As it was mentioned before, the + list of zones to be reRendered can be specified as EL expressi= on. But there is a + question that must be specified more exactly. + The list of Ids is formed during beforePhase of RENDER_RESP= ONSE. Therefore, in this + case one can point reRender to the Set type Bean's proper= ty and fill the Set + during a tracking request. + It's the way to form a list of updatable areas dynamic= ally. +
+
+ + + How to check sending request conditions? Custom JavaScript = before request + "OnSubmit" attribute. + To check on the client some terms of request sending, the <= emphasis role=3D"italic"> + "onSubmit + " attribute is added to all components, which = may cause the request. + + Example: - - The list of Ids is formed during beforePhase of RENDER_RESPONS= E. Therefore, in - this case one can point reRender to the Set type Bean's = property and fill - the Set during a tracking request. - - - It's the way to form a list of updatable areas dynamicall= y. - -
-
- - = - How to check sending request conditions? Custom JavaScript befo= re request. OnSubmit attribute - - To check on the client some terms of request sending, The - "onSubmit - " attribute is added to all components, which may ca= use the request. - Example: - - + ]]> - - So in this case "doSo= mething()" function is executed before the AJAX = request. - - - Besides, if this function returns "false", AJAX requ= est isn't fired. - - - Note: - Behavior of our - "onsubmit" - slightly differs from the standard one. - Do not return - "true" - = -if you want to fire the request - because - -<xxx><a4j:support event=3D"onclick" onsubmit= =3D"return true;"> - is transformed into <xxx onclick=3D"return true; A4J.S= ubmit(.... );" > - and the request isn't fired also in this case (but t= he standard event processing fired). You must only return - "false" - = -if your conditions weren't completed or perform some actions (if need= ed) without any returns in case you need to fire it. - - -
-
- - onCompelete attribute. Differences after release 1.0 - - To avoid differences with other JavaScript attributes, a funct= ion placement in a - JavaScript call is changed, instead of simple inserting of att= ribute content (..oncomplete :anotherFunction(this)..), = - it places (oncomplete: function(){anotherFunction(this);}..) = in anonymous function, - to allow put "chain" of statements in attribute. = - - - Since, - "this" - = -keyword will point to a parameters map instead of a control element as it = was before. - You may use - document.findElementById() - to get references to this object after a request - is processed as when a page is updated in AJAX you will have = reference to a control, = - removed from a DOM tree. - - - Or, if you are sure that your element is not updated, you can = add - "onsubmit" - = -in - <a4j:support> - = - (or onclick in <a4j:comma= ndLink/Button>) to place reference to known variab= le = - (<a4j:commandLink onclick= =3D"var myControl=3Dthis;" oncomplete=3D"anotherFunction(myControl)"/>). - - - New: - - The onComplete syntax now is: - = + So in this case "doSomething()" funct= ion is executed before + the AJAX request. + Besides, if this function returns "false", AJAX r= equest + isn't fired. + + Note: + Behavior of our + "onsubmit" + slightly differs from the standard one. Do not = return + "true" + if you want to fire the request - because + <xxx><a4j:support + event=3D"onclick" onsubmit=3D"return + true;"> + is transformed into <xxx onclick=3D"re= turn true; + A4J.Submit(.... );" > and the request isn't f= ired also in + this case (but the standard event processing fired). You m= ust only return + "false" + if your conditions weren't completed or p= erform some actions + (if needed) without any returns in case you need to fire i= t. + +
+
+ + What is differences of "onCompelete" attribute a= fter release 1.0? + To avoid differences with other JavaScript attributes, a fu= nction placement in a + JavaScript call is changed, instead of simple inserting of att= ribute content + (..oncomplete :anotherFunction(this)..), it places (oncomplete: + function(){anotherFunction(this);}..) in anonymous function, t= o allow put + "chain" of statements in attribute. + Since, + "this" + keyword will point to a parameters map instead of = a control element as it + was before. You may use + document.findElementById() + to get references to this object after a request is= processed as when a page + is updated in AJAX you will have reference to a control, remov= ed from a DOM tree. + Or, if you are sure that your element is not updated, you c= an add + "onsubmit" + in + <a4j:support> + (or onclick in + <a4j:commandLink/Button> + ) to place reference to known variable ( + <a4j:commandLink onclick=3D"var myControl=3Dt= his;" + oncomplete=3D"anotherFunction(myControl)"/> + ). + + New: + The onComplete syntax now is: ]]> - = - - where the event is a variable where the J= S event copy that fires the request is placed into. One may use it to get t= he element instead of this. - and data is a variable that contains dese= rialized value from the data attribute. = - - -
-
- - Is it possible to use InvokeOnComponent with JSF 1.2? - - Ajax4jsf currently does not use invo= keOnComponent because of the 2 reasons: - - - - Compatibility with JSF 1.1 and MyFaces applications is= kept, due to a big = - amount of code used in corporate applications. = = - - - InvokeOnComponent works with= already known clientId, and works fine for = - communication between widget and backed component, or = updates content of = - already rendered component. But there are some trouble= s to use this method for more = - complex use-cases implemented in Ajax4jsf, as there is= a choice for updatable = - components in application logic, where it's neces= sary to navigate in a components = - tree by the native id, with findComponent()<= /property> methods. = - - - - Thus, for example, only entire dataTable can be updated in = - response (but all AJAX action components inside table work pro= perly). - -
-
+ + where the event is a variable wher= e the JS event copy that + fires the request is placed into. One may use it to get th= e element instead of this. + and data is a variable that contains = deserialized value from + the data attribute. + +
+
+ + Is it possible to use InvokeOnComponent with JSF 1.2?</titl= e> + <para> Ajax4jsf currently does not use <emphasis role=3D"italic">i= nvokeOnComponent</emphasis> + because of the 2 reasons: </para> + <itemizedlist> + <listitem> Compatibility with JSF 1.1 and MyFaces applications= is kept, due to a big + amount of code used in corporate applications. </listitem> + <listitem> + <emphasis role=3D"italic"> InvokeOnComponent</emphasis> wo= rks with already known + clientId, and works fine for communication between widget = and backed component, or + updates content of already rendered component. But there a= re some troubles to use + this method for more complex use-cases implemented in Ajax= 4jsf, as there is a choice + for updatable components in application logic, where it&ap= os;s necessary to + navigate in a components tree by the native id, with + <property>findComponent()</property> methods. </listitem> + </itemizedlist> + <para> Thus, for example, only entire dataTable can be updated in = response (but all AJAX + action components inside table work properly). </para> + </section> + <!--<section id=3D"RegionsInDataTables"> <?dbhtml filename=3D"RegionsInDataTables.html"?> <title>Regions in Data Tables The regions in Data Tables aren't supported now, but the fe= ature will be implemented in a new Ajax4jsf version for JSF 1.2. -
-
- - "keepAlive" component generates exception - To avoid this exception, don't forget that the component st= ores beans in serialized view, but your bean should implement java.io.Seria= lizable. -
-
- - Why does filter usage damage an application layout? - Ajax4jsf uses filters for correction of xht= ml code received on an AJAX response, -because when a response is recieved from the server, Ajax4jsf makes direct= changes in -DOM tree and browser doesn't make any corrections in generated xhtml.= There -are two ways for setting filters that could be used i= n an Ajax4jsf-based -application. - = -The first one: - +
--> +
+ + How to avoid generating exception for "keepAlive"= component? + To avoid exception, don't forget that the component sto= res beans in + serialized view, but your bean should implement java.io.Serial= izable. +
+
+ + Why does filter usage damage an application layout? + Ajax4jsf uses filters for correction of= xhtml code received on an + AJAX response, because when a response is recieved from the se= rver, Ajax4jsf makes + direct changes in DOM tree and browser doesn't make any c= orrections in + generated xhtml. There are two ways for setting filt= ers that could + be used in an Ajax4jsf-based application. + The first one: + Ajax4jsf Filter ajax4jsf org.ajax4jsf.Filter ]]> - This filter is based on Tidy Filter usage a= nd recommended for applications -with complicated or non-standard markup, as all the necessary xhtml code -corrections are made by the filter when a response comes from the server.<= /para> - = -Anyway, some obvious errors could damage a layout, if it happens, make sur= e that the -markup corresponds to the xhtml-strict specification. = - = - - The second one: - + This filter is based on Tidy Filter usa= ge and recommended for + applications with complicated or non-standard markup, as all t= he necessary xhtml code + corrections are made by the filter when a response comes from = the server. + Anyway, some obvious errors could damage a layout, if it ha= ppens, make sure that the + markup corresponds to the xhtml-strict specification. + The second one: + org.ajax4jsf.FastFilter ajax4jsf org.ajax4jsf.FastFilter ]]> - This filter is based on the Nekko pacer. In= this case an output xhtml code isn't -strictly verified and it also could cause lot's of errors and corrupt= a layout as -a result. Though if you sure that your application markup is really strict= for this -filter, the filter considerably accelerates all AJAX requests processing. - - Extra information. - - forceParcer parameters setting for filters:= - + This filter is based on the Nekko pacer= . In this case an output + xhtml code isn't strictly verified and it also could caus= e lot's of + errors and corrupt a layout as a result. Though if you sure th= at your application markup + is really strict for this filter, the filter considerably acce= lerates all AJAX requests + processing. + Extra information. + forceParcer parameters setting for filters: + ... forceparser @@ -190,162 +171,172 @@ ... ]]> - The "false" setting for initialization parameter switc= hes off application of filters -for non-AJAX requests, if "true" is chosen, the filter checks all -requests. - - - Changes for Ajax4jsf 1.1.0 - forceparser parameter default value is false from th= is version. - - = - -
-
- - A form isn't submitted or a setter isn't called after= AJAX request - This situation could happen because of conversion/validation err= ors on form -submission. In order to verify this, it's necessary to place this upd= ating via an AJAX -error message inside a form: - + The "false" setting for initialization parameter s= witches off + application of filters for non-AJAX requests, if "true&qu= ot; is chosen, the + filter checks all requests. + Changes for Ajax4jsf 1.1.0 + forceparser parameter default value i= s false from this version. + + +
+
+ + Why form isn't submitted or setter isn't called a= fter AJAX request? + This situation could happen because of conversion/validation= errors on form + submission. In order to verify this, it's necessary to pl= ace this updating via + an AJAX error message inside a form: + ]]> -
+
= -
- - How to create "a4j delayed render zone"? - Component "a4j:support" has a "requestDelay" attribute where you ca= n define the delay. - For information see discussion about this problem on the Ajax4Jsf Users Forum. - -
+
+ + How to create "a4j delayed render zone"? + The <a4j:support> c= omponent has a + "requestDelay" attribute where you can define the de= lay. + More information about this problem could be found on the Ajax4Jsf Users Forum. + +
= = -
- - How to stop "a4j:poll"? - For information see discussion about this problem on the Ajax4Jsf Users Forum. - = - -
+
+ + How to stop "a4j:poll"? + More information about this problem could be found on the Ajax4Jsf Users Forum. + +
= = -
- - = - How to use IgnoreDupResponses and requestDelay - The - "IgnoreDupResponses" - attribute appeared from 1.0.4 RC1 version and is used on= the -client for response ignoring after an AJAX request if a newer request has = been -already sent. - -The additional information you can find here. - +
+ = - - "RequestDelay" - attribute also defines the client behavior. It sets the = time delay, after -which another request could be sent, all other requests are taken away -from a queue except the last one. = - -
+ How to use IgnoreDupResponses and requestDelay? + The + "IgnoreDupResponses" + attribute appeared from 1.0.4 RC1 version and is u= sed on the client for + response ignoring after an AJAX request if a newer request has= been already sent. + The additional information could be found on thehere. + + "RequestDelay" + attribute also defines the client behavior. It set= s the time delay, after + which another request could be sent, all other requests are ta= ken away from a queue + except the last one. +
= = -
- - How to refresh an image using "a4j:support" - For information see discussion about this problem on the Ajax4Jsf Users Forum. - = - -
= - = +
+ + How to refresh an image using <a4j:support> component= ? + More information about this problem could be found on the Ajax4Jsf Users Forum. + +
= - = -
- - How to use EventQueue - The - "EventQueue" - attribute defines the query name where the requests are = saved -before their sending to the server. The queue is created for redundant req= uests -deleting during frequent events, which call several requests forming one a= fter -another. The queue cuts redundant requests and send only the last one. The -queue is created in any case and named on default, the attribute usage only -re-defines this name. - -
= -
- - Is "a4j:page" required or not? - -"a4j:page" is a component used for solving of incompatibility problems in = early Ajax4jsf and MyFaces versions. -The component encodes the full html page structure. - - For information see discussion about this problem on the Ajax4Jsf Users Fo= rum. - = - -
= = -
- - Can I have several "a4j:status" components on one page? - Yes, you can. For more information see example on - JBoss Ajax4jsf O= nline Demos. - -
+
+ + How to use "EventQueue" attribute? + The + "EventQueue" + attribute defines the query name where the request= s are saved before their + sending to the server. The queue is created for redundant requ= ests deleting during + frequent events, which call several requests forming one after= another. The queue cuts + redundant requests and send only the last one. The queue is cr= eated in any case and + named on default, the attribute usage only re-defines this nam= e. +
= -
- - Can I use "a4j:region" within "a4j:repeat"? - - "a4j:region" can't work inside iteration components, like dataTable and r= epeat. - This can be done for a JSF 1.2 targetted build only, at release 1.2.0. - - You can find details here. - = - -
+
+ + Is <a4j:page> component required or not? + + <4j:page> is a compon= ent used for solving + of incompatibility problems in early Ajax4jsf and MyFaces vers= ions. The component + encodes the full html page structure. + More information about this problem could be found on the Ajax4Jsf Users Forum. + +
= -
- - How to reRender only particular row(s) of datatable? - - If you use "rich:dataTable" then you may use ajaxKeys attribute to bind t= he rowKeys to be reRendered there. = - After you need to point reRender on the whole table and only specified ro= ws will be reRedered. - Also you can see example about usage of "a4j:repeat" component - here. - = - -
+
+ + Can I have several <a4j:status> components on one pag= e? + Yes, you can. More information about this problem could be f= ound on the JBoss Ajax4= jsf Online Demos. + +
= +
+ + Can I use <a4j:region> within <a4j:repeat>?</ti= tle> + <para> + <emphasis role=3D"bold"><a4j:region></emphasis> can&apos= ;t work inside + iteration components like <emphasis role=3D"bold"><h:dataTa= ble></emphasis> + and <emphasis role=3D"bold"><a4j:repeat></emphasis>. </p= ara> + <para>The details could be found on the <ulink + url=3D"http://jboss.com/index.html?module=3Dbb&op=3Dvi= ewtopic&t=3D109080" + >here. </ulink> + </para> + </section> = -<section id=3D"RerederingSingleDataTableColumn"> - <?dbhtml filename=3D"RerederingSingleDataTableColumn.html"?> - <title>How to reRender single dataTable column? - For information see discussion about this problem on the Ajax4Jsf Users Forum. - = - -
- = -
- - reRendering failed. Hide/Show the components using rendered</ti= tle> - <para> - During "show/hide" functionality implementation the main error = happens because of the "reRender" attribute of some AJAX Action C= omponent is set on a component that depends on rendered properties, i.e. a = component that is to be hidden/rendered is tried to be updated. The proble= m is that if rendered=3D"false" in this moment, the component isn= 't in the DOM tree and can't be updated because of the general li= mitations described in the Ajax Processing chapter. = -</para> -<para>The correct variant of functionality implantation:</para> + <section id=3D"RerenderingPartPage"> + <?dbhtml filename=3D"RerenderingPartPage.html"?> + <title>How to reRender only particular row(s) of dataTable? + If you use dataTable then you may use ajaxKeys attribute to= bind the rowKeys to be + reRendered there. After you need to point reRender on the whol= e table and only specified + rows will be reRedered. Also the example of usage of <a4j:repeat> component are available here. +
= - -With the rendered attribute wrap the component that is to = be hidden or rendered on AJAX in a wrapper component (e.g. a4j:outputPanel)= = -Set reRender of an AJAX Action component on this wrapper c= omponent instead of the component itself. - +
+ + How to reRender single dataTable column? + More information about this problem could be found on the Ajax4Jsf Users Forum. + +
= -Example: +
+ + Why does reRendering fail? Hide/Show components using rende= red. + During "show/hide" functionality implementation t= he main error + happens because of the "reRender" attribute of some = AJAX Action + Component is set on a component that depends on rendered prope= rties, i.e. a component + that is to be hidden/rendered is tried to be updated. The prob= lem is that if + rendered=3D"false" in this moment, the component isn= 't in the + DOM tree and can't be updated because of the general limi= tations described in + the Ajax Processing chapter. + The correct variant of functionality implantation: = - + + With the rendered attribute wrap the component that = is to be hidden or + rendered on AJAX in a wrapper component (e.g. a4j:outp= utPanel) + + + + Set reRender of an AJAX Action component on this wra= pper component instead of + the component itself. + + + + + Example: + + + = @@ -356,23 +347,29 @@ ... ]]> = -In this case the wrapper component always presents in the DOM tree a= nd its inner content could be updated dynamically on AJAX. -
+ In this case the wrapper component always presents in the DO= M tree and its inner + content could be updated dynamically on AJAX. +
= -
- - Why does JavaScript call don't work in "a4j:include"? - For more information see discussion on this problem on the Ajax4Jsf Users Forum. - = - -
+
+ + Why does JavaScript call don't work in <a4j:include= >? + More information about this problem could be found on the Ajax4Jsf Users Forum. + +
= -
- - What does ResourceNotRegistered Exception mean? +
+ + What does ResourceNotRegistered Exception mean? = - Ajax4jsf registers its resources (scripts, images) after an appl= ication is accessed and then accesses it via a generated URL. During an app= lication development when a developer constantly updates it on the server, = it could happen that Ajax4jsf re-registers its resources after every server= restart and a browser tries to access them via cashed URL. + Ajax4jsf registers its resources (scripts, images) after an = application is accessed + and then accesses it via a generated URL. During an applicatio= n development when a + developer constantly updates it on the server, it could happen= that Ajax4jsf + re-registers its resources after every server restart and a br= owser tries to access them + via cashed URL. = -The problem is solved with browser cash update (e.g. CTRL+F5). + The problem is solved with browser cash update (e.g. CTRL+F5= ). +
- \ No newline at end of file --===============5763949250218360228==--