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

          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
          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...
          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.
          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.
          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.
          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?
          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.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: