Disabling Ajax

compared with
Current by Deryk Sinotte
on Jun 28, 2012 18:02.


 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 9 changes. View first change.

 {warning}Page is currently restricted to internal viewing.{warning}
  h4. Disabling Ajax
  
ICEfaces makes it very easy to add Ajax capabilities to existing JSF applications. Simply adding the icefaces.jar to a JSF application will affect the necessary changes in the page markup to trigger the use of Ajax during interactions with components and during form submission.
  ICEfaces makes it very easy to add Ajax capabilities to existing JSF applications. Simply adding the icefaces.jar to a JSF application adds Ajax by affecting the necessary changes in the page markup. The result is that interactions with the components automatically trigger the use of Ajax during form submission.
  
However, for certain diagnostic situations, it may be useful to turn off ICEfaces' automatic Ajax behaviour. For turning off ICEfaces for a selected view, you can can use the <icecore:config render="false"> tag on the relevant page. For additional details, see the description of the [<icecore:config>|config] tag.
  However, for certain situations (for example diagnosing problems or submitting non-Ajax requests), it may be useful to turn off ICEfaces' automatic Ajax behaviour. There are a number of different ways to accomplish this depending on the level of Ajax support required.
  
If you need to deactivate ICEfaces event capturing in a more specific and selective way, you can simply disable Ajax for that form:
  h5. Disabling ICEfaces for all Views
  
You can use a context parameter in your web.xml to quickly disable ICEfaces' for the entire application:
  
 {panel}
 {code:xml|borderStyle=dashed}
  <context-param>
  <param-name>org.icefaces.render.auto</param-name>
  <param-value>false</param-value>
  </context-param>
 {code}
{panel}
  
 For more information, see the [Configuration] section regarding [ICEfaces rendering|render.auto].
  
  
 h5. Disable ICEfaces for the View
  
 ICEfaces also provides the custom icecore:config tag to turn off rendering for a single view by setting the render attribute to "false" in your markup. This tag works together with the context parameter described above to control ICEfaces on a view-by-view basis.
  
 {code:xml}<icecore:config render="false"/>{code}
  
 For more information, see the [Configuration] section [ICEfaces rendering|render.auto].
  
 h5. Disable Ajax for a Form
  
 For more specific control, you can disable Ajax for a form and it's contents by wrapping it with the f:ajax tag and setting disabled to "true".
  
 {code:xml}
 <h:form >
  <f:ajax event="click" disabled="true" />
 {code}
  
 or wrap that form in an ajax tag:
  
{code}
  {code:xml}
 <f:ajax event="click" disabled="true" >
  <h:form >
 {code}
  
 {note}Note the event="click" is required for the form tag to detect the ajax disabled condition as it does not respond to the default action event of the ajax tag.{note}
  
 However, since the <f:ajax> tag is a standard JSF feature, disabling ICEfaces this way may have unintended side effects during JSF processing. In those cases, ICEfaces provides a custom form attribute:
  
{code}
  {code:xml}
 <h:form >
  <f:attribute name="DISABLE_CAPTURE_SUBMIT" value="true" />
 {code}
  
 If the form element contains the attribute {{DISABLE_CAPTURE_SUBMIT}} then the automatic Ajax capturing function ice.captureSubmit() is not written, effectively disabling ICEfaces event capturing.
  
 {note}This attribute is intended for diagnostic purposes only. It may be changed or removed in future releases.{note}
  
  
 h5. Disable Ajax for a Component
  
 You can also disable Ajax at the level of the individual component:
  
 {code:xml}<h:commandButton value="Send" actionListener="#{bean.sendMessage}">
  <f:ajax disabled="true"/>
 </h:commandButton>{code}
  

© Copyright 2018 ICEsoft Technologies Canada Corp.