ICEfaces
  1. ICEfaces
  2. ICE-7054

Setting <f:ajax disabled="true"> does not work for h:commandLink

    Details

    • Assignee Priority:
      P1
    • Affects:
      Compatibility/Configuration
    • Workaround Exists:
      Yes
    • Workaround Description:
      Where possible, use <f:ajax disabled="true"> with h:commandButton instead of h:commandLink.

      Description

      There are use cases where it's desirable to disable Ajax request processing for specific components. Since ICEfaces automatically enables Ajax for stock components and components that adhere to standard JSF APIs, the recommended strategy is to disable ajax using <f:ajax disabled="true">.

      Testing of the current trunk shows that this technique is currently working for h:commandButtons but not for h:commandLinks.

        Issue Links

          Activity

          Repository Revision Date User Message
          ICEsoft Public SVN Repository #25010 Tue Jul 12 10:22:04 MDT 2011 deryk.sinotte ICE-7054: adding pages to test app and modifying backing bean
          Files Changed
          Commit graph ADD /icefaces2/trunk/icefaces/samples/core/test/fajax/src/main/webapp/disabledCommandLinks.xhtml
          Commit graph ADD /icefaces2/trunk/icefaces/samples/core/test/fajax/src/main/webapp/disabledCommandButtons.xhtml
          Commit graph MODIFY /icefaces2/trunk/icefaces/samples/core/test/fajax/src/main/java/org/icefaces/demo/ajax/AjaxBean.java
          Deryk Sinotte created issue -
          Hide
          Deryk Sinotte added a comment -

          There are a number of different cases that have touched on the subject of using <f:ajax disabled="true">. I've attempted to summarize the history here and provide relevant links.

          The original JIRA for supporting <f:ajax disabled="true"> is http://jira.icefaces.org/browse/ICE-5651. Work was done here to add logic into the FormSubmit event listener to add a hidden input field with ids for each component (or all the components in a form) that have Ajax turned off. The last comment in this case suggest that commandLink was eventually supported at some point.

          Later, another JIRA for <f:ajax disabled="true"> not working correctly http://jira.icefaces.org/browse/ICE-6717 was opened by a user and noted some scenarios where the attribute wasn't functioning properly. Judging from the comments, the additional work to fix this was only confirmed against h:commandButtons. A JIRA was also opened in the Mojarra system (http://java.net/jira/browse/JAVASERVERFACES-2041) about problems using f:ajax with ui:includes. The case remains unresolved and the last comment on June 6, 2011 is:

          "This also affects 2.0.5, and basically borks all ajax calls after the first one when using facelets templates, thus rendering the ajax functionality of JSF basically useless. This is a pretty serious bug."

          Additional work for http://jira.icefaces.org/browse/ICE-6327 was done to try to improve commandButtons and commandLinks that have f:params associated with them as these component will decorate the onClick handler with a Mojarra JS call that adds in the extra parameters like this:

          <a href="#" id="link1" onclick="mojarra.jsfcljs(document.getElementById('form1'),

          {'link1':'link1','commandparam':'linkparam'}

          ,'');return false">Show/Hide</a>

          It's possible this same issue is responsible for the issues we continue to see with h:commandLinks. There were also comments to the effect that the f:ajax setting does not/ can not directly affect h:forms, only the components inside the form.

          The case http://jira.icefaces.org/browse/ICE-6685 was opened by a user and refers to <f:ajax disabled="true"> not working with ace:pushButton.

          The cases http://jira.icefaces.org/browse/ICE-6806 and http://jira.icefaces.org/browse/ICE-6814 refer to compatibility of the PrimeFaces FileDownload and DataExporter components with ICEfaces 2. Ted recommended using <f:ajax disabled="true"> but it didn't seem to work. Other approaches/code changes were discussed based on mobility work. This still didn't solve the problem for h:commandLink.

          Show
          Deryk Sinotte added a comment - There are a number of different cases that have touched on the subject of using <f:ajax disabled="true">. I've attempted to summarize the history here and provide relevant links. The original JIRA for supporting <f:ajax disabled="true"> is http://jira.icefaces.org/browse/ICE-5651 . Work was done here to add logic into the FormSubmit event listener to add a hidden input field with ids for each component (or all the components in a form) that have Ajax turned off. The last comment in this case suggest that commandLink was eventually supported at some point. Later, another JIRA for <f:ajax disabled="true"> not working correctly http://jira.icefaces.org/browse/ICE-6717 was opened by a user and noted some scenarios where the attribute wasn't functioning properly. Judging from the comments, the additional work to fix this was only confirmed against h:commandButtons. A JIRA was also opened in the Mojarra system ( http://java.net/jira/browse/JAVASERVERFACES-2041 ) about problems using f:ajax with ui:includes. The case remains unresolved and the last comment on June 6, 2011 is: "This also affects 2.0.5, and basically borks all ajax calls after the first one when using facelets templates, thus rendering the ajax functionality of JSF basically useless. This is a pretty serious bug." Additional work for http://jira.icefaces.org/browse/ICE-6327 was done to try to improve commandButtons and commandLinks that have f:params associated with them as these component will decorate the onClick handler with a Mojarra JS call that adds in the extra parameters like this: <a href="#" id="link1" onclick="mojarra.jsfcljs(document.getElementById('form1'), {'link1':'link1','commandparam':'linkparam'} ,'');return false">Show/Hide</a> It's possible this same issue is responsible for the issues we continue to see with h:commandLinks. There were also comments to the effect that the f:ajax setting does not/ can not directly affect h:forms, only the components inside the form. The case http://jira.icefaces.org/browse/ICE-6685 was opened by a user and refers to <f:ajax disabled="true"> not working with ace:pushButton. The cases http://jira.icefaces.org/browse/ICE-6806 and http://jira.icefaces.org/browse/ICE-6814 refer to compatibility of the PrimeFaces FileDownload and DataExporter components with ICEfaces 2. Ted recommended using <f:ajax disabled="true"> but it didn't seem to work. Other approaches/code changes were discussed based on mobility work. This still didn't solve the problem for h:commandLink.
          Patrick Dobler made changes -
          Field Original Value New Value
          Link This issue blocks ICE-7405 [ ICE-7405 ]
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s EE-2.0.0.GA_P01 [ 10271 ]
          Fix Version/s 2.1 [ 10241 ]
          Affects [Compatibility/Configuration]
          Assignee Priority P1
          Assignee Ted Goddard [ ted.goddard ]
          Ken Fyten made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Fix Version/s 3.0.RC2 [ 10313 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Ted Goddard
              Reporter:
              Deryk Sinotte
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: