2 Replies Latest reply on Aug 20, 2008 2:32 PM by shadowcreeper

    scrollerListener Not Firing With rich:datascroller

      I am building a Seam-RichFaces app that utilizes rich:datascroller. I want to bind a listener that fires when the user hits one of the scroll buttons.

      Here is my listener method (as found in a Seam component called searchAction):

      public void doScroll(DataScrollerEvent event) {
       logger.debug("searchAction.doScroll");
      }
      


      Here is the markup in my facelet:

      <rich:datascroller id="searchResultsScroller"
       for="searchResults"
       scrollerListener="#{searchAction.doScroll}"
       boundaryControls="show"
       fastControls="show"
       stepControls="hide"
       renderIfSinglePage="false"/>
      


      Unfortunately, the listener method called searchAction.doScroll does not fire as evidenced by the fact I see no log message.

      Can anyone help me figure out why my listener won't fire? I appreciate any insight.

      Please let me know if I can provide further information.

      Thanks.

        • 1. Re: scrollerListener Not Firing With rich:datascroller

          I remain stumped on this issue, but what is funny is that I can assign an action to my rich:datascroller. In other words, if I add this attribute:

          action="#{searchAction.doScroll}"
          


          ...then the action does indeed fire. Unfortunately, this is not sufficient for me since I need access to the DataScrollerEvent object, and action methods cannot take parameters.

          Any help you can provide is appreciated.

          Thanks.

          • 2. Re: scrollerListener Not Firing With rich:datascroller
            shadowcreeper

            Parameter component for action or actionListener:

            <a4j:actionparam name="unusedParameterToHelpDocumentYourCode" assignTo="#{bean.propertyToSet}" value="#{elExpresionOfValueToSet}"/>
            


            Note: There is currently a bug (I forget the exact details) where either action or actionListener will happen before the actionparams are called. Using the other is the workaround.

            Also, if this is used in a jsFunction called with parameters, you do not need the value attribute.