Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need facet selection event #40

Open
karger opened this issue Feb 15, 2012 · 3 comments
Open

Need facet selection event #40

karger opened this issue Feb 15, 2012 · 3 comments

Comments

@karger
Copy link
Contributor

karger commented Feb 15, 2012

The scripted event api https://github.com/zepheira/exhibit3/wiki/Scripted-Event-API currently does not include an event triggered when someone changes the selection on a facet---only when they clear it.

@zepheiryan
Copy link
Member

I passed on this in the first draft as every facet would need to implement it a little differently depending on its nature. Some knowledge of usage of this event would help in forming what it would pass on, etc. Should it merely signal that something changed? Also put out what selection was chosen? Un-chosen? Added? Which text was written in the text search - so far, or after a reasonable pause in typing? Or just the actual facet instance so the rest can be determined programmatically by interrogating the object?

@karger
Copy link
Contributor Author

karger commented Feb 19, 2012

I'm not convinced that we have so many different kinds of facets. We have several enumerated types, where the obvious thing is to report the list of selected values, and we have some range types, where it is reasonable to report upper and lower limits of the selection.

Passing the facet instance does seem to be a reasonable backup; it at least allows anyone who cares to do something about it.

Related question: should such facet change events be used to notify views (and other facets) that they should update? Is that already how it's implemented?

@zepheiryan
Copy link
Member

Facets directly notify collections of changes through the collection API and duck typing, and the collection then informs all components in its purview of the changes. This might be better replaced by a mirror Event API, but I won't have time to look into that for this revision.

I was talking about code reuse. It doesn't really matter how similar some are in the abstract; that doesn't reduce the amount of code that needs to be written, though some of it is going to look similar.

Those questions are getting at what you want from an event: a delta or the current state. Unless your own listening code is recording a history of each state, you won't know exactly what changed if it's just the facet object that gets passed along. Though it should probably get passed along regardless. So how are you intending to use this event?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants