Disabling AjaxICEfaces 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 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. Disabling ICEfaces for all ViewsYou can use a context parameter in your web.xml to quickly disable ICEfaces' for the entire application: <context-param> <param-name>org.icefaces.render.auto</param-name> <param-value>false</param-value> </context-param> For more information, see the Configuration section regarding ICEfaces rendering. Disable ICEfaces for the ViewICEfaces 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. <icecore:config render="false"/>
For more information, see the Configuration section ICEfaces rendering. Disable Ajax for a FormFor 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". <h:form > <f:ajax event="click" disabled="true" /> or wrap that form in an ajax tag: <f:ajax event="click" disabled="true" > <h:form >
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: <h:form > <f:attribute name="DISABLE_CAPTURE_SUBMIT" value="true" /> 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.
Disable Ajax for a ComponentYou can also disable Ajax at the level of the individual component: <h:commandButton value="Send" actionListener="#{bean.sendMessage}"> <f:ajax disabled="true"/> </h:commandButton> |
Disabling Ajax
© Copyright 2021 ICEsoft Technologies Canada Corp.