-
1. Re: Events not appearing.
tony.herstell1 Feb 15, 2008 3:51 AM (in response to tony.herstell1)I managed to get the event to fire by altering the 'firing' code to :
public void setRiders(int number) { this.riders = number; Events.instance().raiseEvent("numbersChanged"); }
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.herstell1 Feb 15, 2008 4:04 AM (in response to tony.herstell1)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) { Events.instance().raiseEvent("numbersChanged"); } }
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.herstell1 Feb 15, 2008 4:15 AM (in response to tony.herstell1)Using a side effect of another call (that really should even be called) I have hacked it:
`@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void setReason(BookingReasonsKind reason) {
log.info(">setReason");
booking.setReason(reason);
// HACKITY HACK
handleNumbersChanged();`
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" />`
</rich:inputNumberSpinner>
</rich:column> -
4. Re: Events not appearing.
pmuir Feb 18, 2008 1:59 PM (in response to tony.herstell1)Please file a JIRA with a simple runnable test for us to look at.