Skip to content

Architecture: Widgets

James McKinney edited this page Apr 13, 2013 · 5 revisions

Table of Contents

Widgets inspect the JSON response retrieved from Solr by the Manager and update the interface accordingly.

AbstractWidget is the base class from which all other widgets inherit. Every widget takes a required id, to identify the widget, and an optional target. target is usually the CSS selector for the HTML element that the widget updates after each Solr request.

AbstractWidget defines three abstract methods: init, called by the Manager’s init method, performs one-time initializations; beforeRequest is called by the Manager’s doRequest method before the request is sent to Solr; and afterRequest is called by the Manager’s handleResponse method after a response is received from Solr.

AJAX Solr defines abstract widgets to get you started writing your own widgets. To benefit from the convenient functions contained in these widgets, you need only write a new widget inheriting from one of these widgets.

These abstract widgets include: