Awesome! Thanks for the help Axel. It works great now. -Marc
From: [email protected] [mailto:[email protected]] On Behalf Of Axel Hecht Sent: Tuesday, September 22, 2009 3:33 AM To: [email protected] Subject: [Simile-Widgets] Re: parameterized hyperlinks to pre-filter exhibit For the search facet, you could use queryParamName, http://simile.mit.edu/mail/ReadMsg?listName=General&msgId=22604. It might be depending on the version of exhibit you're using, too. Looking at the trunk sources, the ex:selection should work as well. And yes, examples outside your intranet would be more helpful :-) Axel 2009/9/22 Shecter, Marc <[email protected]<mailto:[email protected]>> Awesome! Axel thank you. I was able to implement your recommendations. I can now create a parameterized link like this: http://lectora/v5-5/media/exhibit%20with%20parameterized%20urls.html?year=2007&customers=SDE The code works great for my check-box facets but I have a Search-box facet. I can't get the code to work with it. I've created a url: http://lectora/v5-5/media/exhibit_with_parameterized_urls.html?year=2009&customers=SDE&search=Features It fills in the "year" and "customers" facet, but not the "search" facet box. As shown here: http://screencast.com/t/byiHTItkEqZ2. I'm guessing that one can't fill in a search box with a parameterized URL. Here's my code: <html> <head> <title>My Exhibit's Title</title> <link href="consumer2.js" type="application/json" rel="exhibit/data" /> <script src="http://knetcontent/exhibit/api/exhibit-api.js?autoCreate=false" type="text/javascript"></script> <script type="text/javascript"> SimileAjax.jQuery(document).ready(function() { var fDone = function() { var params = SimileAjax.parseURLParameters(); var options = ["search","year","customers"]; for ( var i in options ) { var option = options[i]; if (option in params) { if (params[option]) { document.getElementById(option + "-facet").setAttribute("ex:selection", params[option]); } else { document.getElementById(option + "-facet").setAttribute("ex:selectMissing", "true"); } } } window.exhibit = Exhibit.create(); window.exhibit.configureFromDOM(); }; window.database = Exhibit.Database.create(); window.database.loadDataLinks(fDone); }); </script> <!--Zebra Styling on Table View--> <script> var zebraStyler = function(item, database, tr) { if (tr.rowIndex % 2) { tr.style.background = '#eee'; } else { tr.style.background = '#ccc'; } } </script> </head> <body> <table width="786"> <tr> <td width="79%" ex:role="viewPanel"> <!-- Lens--> <div class="item" ex:role="lens" style="display: none;"> <table cellpadding="1" width="100%"> <tr> <td><div><b><span ex:content=".label"></span></b></div></td> </tr> <tr> <td><div><span ex:content=".Date"></span></div></td> </tr> <tr> <td><div><span ex:content=".description"></span></div></td> </tr> </table> </div> <!--END LENS--> <!--each of the views below replicates the data linearly down the page--> <!--TABLE VIEW--> <div ex:role="view" ex:viewClass="Tabular" ex:columns=".Date,.label" ex:columnLabels="Date, Event" ex:rowStyler="zebraStyler" ex:showHeader="true" ex:showSummary="true" ex:border="1" ex:showToolbox="false" ex:label="Summary"> </div> <!--Tile VIEW--> <div ex:role="view" ex:viewClass="Tile" ex:Orders =".Year" ex:possibleOrders =".Year,.Event-Type" ex:showToolbox="false" ex:label="Details" > </div> </td> <td width="1 PX"></td> <td width="20%" valign="top"> <br><br> <a target="_blank" href="../popups_timeline_help.html">Help</a><b><br> Search</b> <div ex:role="facet" ex:facetClass="TextSearch" id="search-facet"> </div> <div ex:role="facet" ex:expression=".Platform" ex:scroll="true" ex:height="50" ex:facetLabel="Customer Platforms" id="customers-facet"> </div> <div ex:role="facet" ex:expression=".Year" ex:scroll="true" ex:sortMode="value" ex:sortDirection="reverse" ex:facetLabel="Year" id="year-facet"> </div> <div ex:role="facet" ex:expression=".Event-Type" ex:scroll="true" ex:facetLabel="Event Types"> </div> </td> </tr> <!-- <tr> <td width="79%" ex:role="viewPanel"> </td> <td width="1 PX"> </td> <td width="20%" valign="top" class="style1"><br></td> </tr> --> </table> </body> </html> ------------------------------------------------------------------------------------------------------------------------------------------------------ Marc Shecter | My Internal Blog | Reports from KNET? You Betcha! | My Books Available for Borrowing Senior Program Manager 206-266-5583 From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Axel Hecht Sent: Monday, September 21, 2009 1:26 PM To: [email protected]<mailto:[email protected]> Subject: [Simile-Widgets] Re: parameterized hyperlinks to pre-filter exhibit You don't have a "year-facet" in your code, AFAICT. If you just have one facet, there's no need to do any kind of general tweaks so you could call it as you wish. PS: In general, doing public web pages helps a ton in debugging exhibits. As do extensions like firebug or other web developer extensions that'd display js errors. Which IMHO you should have got here. Axel --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en -~----------~----~----~----~------~----~------~--~---
