ICEfaces
  1. ICEfaces
  2. ICE-7168

ICEfaces jsf.js event handlers interfere with non-ICEfaces content

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.1-Beta, 2.1-Beta2, 3.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces, non-ICEfaces

      Description

      ICEfaces should not interfere with the Ajax functions of non-ICEfaces pages.

        Issue Links

          Activity

          Lucas Theisen created issue -
          Lucas Theisen made changes -
          Field Original Value New Value
          Link This issue depends on ICE-4949 [ ICE-4949 ]
          Hide
          Lucas Theisen added a comment -

          ---- CLONED FROM http://jira.icefaces.org/browse/ICE-4614 AS THERE IS NO OPTION TO REOPEN ----

          Really? The only workaround is to: "Use ICEfaces everywhere."? This is a problem as I have a portal which mixes all kinds of portlets. Some are jsp, some jsf, and some jsf with icefaces. The problem is those that are just plain jsf have all of their ajax requests hijacked by icefaces. This is causing failures here:

          function configurationOf(element) {
          return detect(parents(element),
          function(e)

          { >>> return e.configuration; }

          ).configuration;
          }

          Since the portlet did not have the icefaces jar, it did not inject the .configuration property that this method is looking for, so this function actually returns null and any attempt to make a call against the returned value will fail. Is there a way to tell icefaces to ignore this portlet? Or more to the point could you have icefaces only hijack the functions of portlets that have the icefaces jar in their lib?

          A little more investigation shows that this is done when icefaces registers an onEvent handler through a call to jsf.ajax.addOnEvent. Perhaps the handler method could fail gracefully if the configuration is not found that way the request could proceed and jsf ajax could work even with icefaces adding that handler? It seems that icefaces interfering with other non-icefaces content is a major design flaw.

          Show
          Lucas Theisen added a comment - ---- CLONED FROM http://jira.icefaces.org/browse/ICE-4614 AS THERE IS NO OPTION TO REOPEN ---- Really? The only workaround is to: "Use ICEfaces everywhere."? This is a problem as I have a portal which mixes all kinds of portlets. Some are jsp, some jsf, and some jsf with icefaces. The problem is those that are just plain jsf have all of their ajax requests hijacked by icefaces. This is causing failures here: function configurationOf(element) { return detect(parents(element), function(e) { >>> return e.configuration; } ).configuration; } Since the portlet did not have the icefaces jar, it did not inject the .configuration property that this method is looking for, so this function actually returns null and any attempt to make a call against the returned value will fail. Is there a way to tell icefaces to ignore this portlet? Or more to the point could you have icefaces only hijack the functions of portlets that have the icefaces jar in their lib? A little more investigation shows that this is done when icefaces registers an onEvent handler through a call to jsf.ajax.addOnEvent. Perhaps the handler method could fail gracefully if the configuration is not found that way the request could proceed and jsf ajax could work even with icefaces adding that handler? It seems that icefaces interfering with other non-icefaces content is a major design flaw.
          Hide
          Judy Guglielmin added a comment -

          for your evaluation

          Show
          Judy Guglielmin added a comment - for your evaluation
          Judy Guglielmin made changes -
          Assignee Judy Guglielmin [ judy.guglielmin ] Ted Goddard [ ted.goddard ]
          Ted Goddard made changes -
          Assignee Ted Goddard [ ted.goddard ] Mircea Toma [ mircea.toma ]
          Hide
          Ted Goddard added a comment -

          Do you know which event is actually causing the problem?

          Show
          Ted Goddard added a comment - Do you know which event is actually causing the problem?
          Hide
          Lucas Theisen added a comment - - edited

          This is a snippit of my own code:

          _keyUp : function(e) {
          if ( e.which === 38 )

          { // up arrow e.preventDefault(); this._selectableList && this._selectableList.selectPrevious(); return; }

          if ( e.which === 40 )

          { // down arrow e.preventDefault(); this._selectableList && this._selectableList.selectNext(); return; }

          if ( this._keywordsField.get( "value" ).length >= this.get( "minimumChars" ) ) {
          jsf.ajax.request(
          Y.Node.getDOMNode( this._keywordsField ),
          e,

          { execute : this.get("keywordsId"), render : this.get("resultsId"), onevent : Y.bind( this._searching, this ) }

          );
          }
          else

          { this._hideResults(); }

          },

          I am making my own jsf.ajax.request call prompted by a keyUp event.

          ------

          sorry for the formatting, i cant seem to find a way to get jira to recognized this snippit as code...

          Show
          Lucas Theisen added a comment - - edited This is a snippit of my own code: _keyUp : function(e) { if ( e.which === 38 ) { // up arrow e.preventDefault(); this._selectableList && this._selectableList.selectPrevious(); return; } if ( e.which === 40 ) { // down arrow e.preventDefault(); this._selectableList && this._selectableList.selectNext(); return; } if ( this._keywordsField.get( "value" ).length >= this.get( "minimumChars" ) ) { jsf.ajax.request( Y.Node.getDOMNode( this._keywordsField ), e, { execute : this.get("keywordsId"), render : this.get("resultsId"), onevent : Y.bind( this._searching, this ) } ); } else { this._hideResults(); } }, I am making my own jsf.ajax.request call prompted by a keyUp event. ------ sorry for the formatting, i cant seem to find a way to get jira to recognized this snippit as code...
          Ted Goddard made changes -
          Summary CLONE -Standard JSF Ajax compatibility ICEfaces jsf.js event handlers interfere with non-ICEfaces content
          Salesforce Case []
          Deryk Sinotte made changes -
          Summary ICEfaces jsf.js event handlers interfere with non-ICEfaces content CLONE -Standard JSF Ajax compatibility
          ICEsoft Forum Reference http://www.icefaces.org/JForum/posts/list/19846.page
          Salesforce Case []
          Fix Version/s 2.1 [ 10241 ]
          Fix Version/s 2.0-Alpha2 [ 10214 ]
          Fix Version/s 2.0.0 [ 10230 ]
          Affects Version/s 2.0.2 [ 10273 ]
          Affects Version/s 2.0-Alpha1 [ 10213 ]
          Deryk Sinotte made changes -
          Summary CLONE -Standard JSF Ajax compatibility ICEfaces jsf.js event handlers interfere with non-ICEfaces content
          Salesforce Case []
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #25400 Mon Sep 05 08:30:26 MDT 2011 mircea.toma ICE-7168 Register event and error callbacks with JSF bridge only when ICEfaces submit functions are invoked.
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/application.js
          Commit graph MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/javascript/status.js
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/submit.js
          Hide
          Mircea Toma added a comment -

          Modified submit event and submit error callbacks registration with JSF bridge so that the callbacks are invoked only when ICEfaces submit functions are used.

          Show
          Mircea Toma added a comment - Modified submit event and submit error callbacks registration with JSF bridge so that the callbacks are invoked only when ICEfaces submit functions are used.
          Mircea Toma made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #25419 Wed Sep 07 14:27:59 MDT 2011 mircea.toma ICE-7168 Put back ice.onSubmitSend and ice.onSubmitResponse since they're part of the public API.
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/application.js
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #25420 Wed Sep 07 14:30:46 MDT 2011 mircea.toma ICE-7168 Mark functions as deprecated.
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/application.js
          Ken Fyten made changes -
          Link This issue blocks ICE-7240 [ ICE-7240 ]
          Hide
          Ken Fyten added a comment -

          Need to revert these changes as we require the ICEfaces callbacks to be invoke via regular JSF for none-portlet scenarios.

          A refined solution will need to be found to only enable these callbacks if a submit originates in a component inside and ICEfaces portlet in the portlet scenario, and to always enable this in a none-portlet scenario.

          Show
          Ken Fyten added a comment - Need to revert these changes as we require the ICEfaces callbacks to be invoke via regular JSF for none-portlet scenarios. A refined solution will need to be found to only enable these callbacks if a submit originates in a component inside and ICEfaces portlet in the portlet scenario, and to always enable this in a none-portlet scenario.
          Ken Fyten made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Assignee Priority P1
          Ken Fyten made changes -
          Link This issue blocks ICE-7203 [ ICE-7203 ]
          Ken Fyten made changes -
          Salesforce Case []
          Assignee Priority P1 P2
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #25823 Tue Oct 04 13:55:23 MDT 2011 mircea.toma ICE-7168 Stop invoking the ICEfaces callbacks when submit events are triggered from forms that are not ICEfaces enabled.
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/application.js
          Hide
          Mircea Toma added a comment -

          Introduced event filtering function that allows the invocation of ICEfaces callbacks only when the submitted form is ICEfaces enabled.

          Show
          Mircea Toma added a comment - Introduced event filtering function that allows the invocation of ICEfaces callbacks only when the submitted form is ICEfaces enabled.
          Mircea Toma made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Lucas Theisen added a comment -

          Does this mean there is now a way to specify that some forms are icefaces and others are not within the same servlet/portlet? Or does the inclusion of icefaces.jar in the .war itself mean that all the forms on that servlet/portlet are icefaces forms? Also, is this fix available or do I need to wait until the 2.1 release? Is there a projected timeline for that release?

          Show
          Lucas Theisen added a comment - Does this mean there is now a way to specify that some forms are icefaces and others are not within the same servlet/portlet? Or does the inclusion of icefaces.jar in the .war itself mean that all the forms on that servlet/portlet are icefaces forms? Also, is this fix available or do I need to wait until the 2.1 release? Is there a projected timeline for that release?
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s 2.1-Beta [ 10291 ]
          Hide
          Mircea Toma added a comment -

          > Does this mean there is now a way to specify that some forms are icefaces and others are not within the same servlet/portlet?

          No, right now all the forms within a page or portlet are ICEfaces enabled. We haven't had any real world use cases where the ICEfaces features would be enabled with finer detail.

          > Or does the inclusion of icefaces.jar in the .war itself mean that all the forms on that servlet/portlet are icefaces forms?

          Yes, it does. Still, input components can have their AJAX submit disabled with <f:ajax disabled="true"> tag.

          > Also, is this fix available or do I need to wait until the 2.1 release?

          The fix is available in the public SVN repository. Officially it will be part of 2.1 release.

          > Is there a projected timeline for that release?

          End of October, I believe.

          Show
          Mircea Toma added a comment - > Does this mean there is now a way to specify that some forms are icefaces and others are not within the same servlet/portlet? No, right now all the forms within a page or portlet are ICEfaces enabled. We haven't had any real world use cases where the ICEfaces features would be enabled with finer detail. > Or does the inclusion of icefaces.jar in the .war itself mean that all the forms on that servlet/portlet are icefaces forms? Yes, it does. Still, input components can have their AJAX submit disabled with <f:ajax disabled="true"> tag. > Also, is this fix available or do I need to wait until the 2.1 release? The fix is available in the public SVN repository. Officially it will be part of 2.1 release. > Is there a projected timeline for that release? End of October, I believe.
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s 2.1-Beta2 [ 10294 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Lucas Theisen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: