Product DocsMenu

Coveo Platform 6.5 >
Developer Help > Search Interface API > Basic Concepts > About Ajax and SearchUpdatePanel

About Ajax and SearchUpdatePanel

CES uses advanced Ajax techniques to provide a more streamlined user experience. Most of the time, when customizing the search interface, the user does not need take care of it; however, there are some cases where additional knowledge is required.

The Coveo search interface uses a model that is very close to Microsoft Ajax UpdatePanels in order to update parts of the Search page when a user performs actions without fully reloading the page (referred to as postback). Instead, it uses JavaScript code to perform a partial postback on the server, that executes the required actions and renders new HTML for the parts of the page to update.

The zones that can be updated are defined by the SearchUpdatePanel control. Whenever a control inside SearchUpdatePanel must be updated, the HTML for the whole content of the nearest SearchUpdatePanel is rendered, sent to the browser and then updated. A SearchUpdatePanel can contain other SearchUpdatePanel controls. When the ASP.NET request reaches the Render phase, the search interface uses different factors to build a list of panels in order to update and only the HTML for these specific panels is sent to the browser.

How the Search Interface Determines which Panels to Update

During request processing, SearchControl keeps track of several events that can cause certain controls to require an update. The following lists these events:

  • A new query has been performed
  • The staging settings have been modified
  • The effective settings have been modified
  • The Mode of the search interface has been modified
  • The current result page has been modified
  • The currently selected result has been modified
  • A saved query or saved filter has been modified

When request processing reaches the Render phase, each SearchUpdatePanel recursively scans its children, looking for controls implementing special marker interfaces associated to the events that the SearchControl keeps track of. The available marker interfaces are:

When a control implementing one of the marker interface is found and the associated event has been raised during processing, the SearchUpdatePanel automatically schedules itself for updating. The parent SearchUpdatePanel does not access the child SearchUpdatePanel, as it assumes that it updates itself automatically.

Making Updates More Granular

In order for updates to be more granular, it is possible to add SearchUpdatePanel controls to the custom skins in order to wrap around the zones to update. No further logic is required, the search interface automatically uses these new panels when possible.

Writing New Controls Managed by SearchUpdatePanels

The updates of the custom search control developed are managed by SearchUpdatePanel. In some cases, ex.: for controls used to render information about a result (typically in result templates), the user does not manage this, as it is automatically updated when the result changes. However, if a user develops his own search controls, he must determine which event causes its rendered HTML to be updated, and implement the associated marker interfaces. Then, the control is automatically updated whenever required.

Forcing the Update of a Control in Code

It is possible to force a specific control to be updated (through the nearest SearchUpdatePanel) by calling UpdatePanel.UpdateContainingPanel and passing a reference to the control to update.