exhibit list-facet state

43 views
Skip to first unread message

Marco De Salvo

unread,
Dec 5, 2008, 2:18:03 PM12/5/08
to SIMILE Widgets
Dear all,
i would like to know if there exists one way to extract the selected
values from a list-facet, to be able to reconstruct the state of its
selections: actually i have a complicated way like this:

var actualFacetSelection=getElementsByClassName("exhibit-facet-value
exhibit-facet-value-selected","div"); // returns, for example:
facet1item2,facet2item3,facet2item4

which returns a comma-separated list of all the actual selected items
of all my list-facets. That comma-separated list is then used by me to
control an OpenLayers and a Timeline.

I suppose there must be a more elegant way in the API to do so, but i
don't know it. I use the exhibit-2.1 release.

This is my case: http://www.archeoserver.it/demoMI/

Please help me :-|

David Huynh

unread,
Dec 6, 2008, 8:26:39 PM12/6/08
to simile-...@googlegroups.com
Marco,

First, give the facet an ID

<div ex:role="facet" id="facet-x" ...></div>

Then this gets you an array of the selected values

window.exhibit.getComponent("facet-x")._valueSet.toArray()

David

Marco De Salvo

unread,
Dec 7, 2008, 8:42:58 AM12/7/08
to SIMILE Widgets
Thanks David, it works nicely!
Reply all
Reply to author
Forward
0 new messages