Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: driscoll
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

Add ability to cancel a client side listener

Created: 02/Dec/09 08:23 AM   Updated: 23/Dec/13 10:56 PM
Component/s: Ajax/JavaScript
Affects Version/s: 2.0
Fix Version/s: 2.3

Time Tracking:
Not Specified


Operating System: All
Platform: All

Issuezilla Id: 685
Status Whiteboard:

size_large importance_large

Participants: driscoll, Ed Burns, ganeshpuri, rogerk and werpu12

 Description  « Hide

Sometimes, the page author would like to cancel a client side event listener.

currently, there is no way to do this - you would have to instead code the
listening function to stub out if some value were set, instead, or overwrite the
function with a noop. That's awkward.

Instead, it would be desired that the listener be removed from the list of
listeners that the JSF client library keeps.

One way to do this would be to have the addListener function return a token, and
have a separate, cancel(token) function which would remove the listener
represented by that token.

ganeshpuri added a comment - 21/Jan/10 11:17 AM

corrected target

Ed Burns added a comment - 22/Jun/10 09:04 PM


rogerk added a comment - 23/Jun/10 07:42 AM


rogerk added a comment - 29/Jun/10 12:05 PM


rogerk added a comment - 01/Jul/10 12:02 PM


rogerk added a comment - 27/Aug/10 06:12 AM

For now re-target for 2.2.
If time permits may revisit for 2.1.

rogerk added a comment - 16/Nov/10 12:44 PM


werpu12 added a comment - 09/Mar/12 08:48 AM

The token approach is not needed, a client which registers a listener should always know the function. I guess a simple remove listener should be enough.
so that we have jsf.ajax.addListener and jsf.ajax.removeListener.
It is as simple as that and can be easily implemented.