4 Replies Latest reply on Feb 18, 2008 1:59 PM by Pete Muir

    Events not appearing.

    Tony Herstell Master

      I have an entity

      public class BookingResourceWithRiders extends BookingResourceWithHoursRange implements Serializable {

      with a method:

              public void setRiders(int number) {
                      this.riders = number;

      I expected it to throw an event to be caught in a controller bean:

      public class BookingControllerImpl implements BookingController, Serializable {

      in this method:

              public void handleNumbersChanged() {

      I have NOT added anyting to components.xml (as per the doco).

      I am not seeing the event.

      Any ideas what the voodoo required is?

        • 1. Re: Events not appearing.
          Tony Herstell Master

          I managed to get the event to fire by altering the 'firing' code to :

               public void setRiders(int number) {
                    this.riders = number;

          Is this a BUG?

          Now since this is being ultimately driven from Ajax (RF).. you quite often get a few calls for the same click on the UI.
          The Event is only raised for the FIRST event.. which annoyingly always has the number 1 !!!

          In the debugger I can see the second call come though to setRiders with the number 4 (in this case), but the event numbersChanged is not raised again...

          Is this a BUG?

          • 2. Re: Events not appearing.
            Tony Herstell Master

            Darn; I cant hack it like this as for some reason it wont throw the  event as somehow it seems to know it's the second time in the routine during this cycle

                 public void setRiders(int number) {
                      this.riders = number;
                      if (riders!=1) {

            Any suggestions on either a fix or how to reset this invisible counter would be appreciated (its a nasty hack so a solution would be preferable).

            • 3. Re: Events not appearing.
              Tony Herstell Master
              Using a side effect of another call (that really should even be called) I have hacked it:

                   public void setReason(BookingReasonsKind reason) {
                        // HACKITY HACK

              Nice to see if there is a solution.

              In case it helps... this is all Ajaxified and the source UI is :

              `<!-- Number of Riders (Arenas) -->
              <rich:column colspan="3" breakBefore="true" rendered="#{(bookingController.reason == 'ONE_HOUR_PRIVATE' || bookingController.reason == 'ONE_HOUR_OPEN') and (eachResource.resource.kind == 'INDOOR_ARENA' || eachResource.resource.kind == 'DRESSAGE_ARENA' || eachResource.resource.kind == 'SJ_ARENA')}">
                   <h:outputText value="#{messages.booking_number_of_riders}" />
                   <rich:inputNumberSpinner id="riderNumbers" immediate="true" enableManualInput="false" minValue="1" maxValue="6" step="1" value="#{eachResource.riders}">
                   <a4j:support event="onchange" eventsQueue="eventsQueue" requestDelay="2000" />`

              • 4. Re: Events not appearing.
                Pete Muir Master

                Please file a JIRA with a simple runnable test for us to look at.