Widget response structure

Many widgets support dynamic behavior actions. The widget:load and widget:refresh actions retrieve the contents of a URL. These actions can be used to either update state on the client, server or both. For example, widgets can update their content, or periodically use the server session to ensure that it does not time out while the user is completing a form.

Many widgets support dynamic behavior actions. The widget:load and widget:refresh actions retrieve the contents of a URL. These actions can be used to either update state on the client, server or both. For example, widgets can update their content, or periodically use the server session to ensure that it does not time out while the user is completing a form.

Note:

Response is sent as an answer to an AJAX request. It must not be embedded in the XDIME page.

XDIME 2 response elements

You use the same elements from the response: namespace to define the outermost structure. The structure of other response elements depends on the associated widget.

Elements Notes
response:response The containing element of the response
response:head Contains the theme binding; needed only when the response contains styled content
response:link Provides a link to the theme
response:body Contains the widget response

Example

Replace the existing content of a Carousel widget. Styles for each list item are specified in the /main.mthm theme file.

<?xml version="1.0" encoding="UTF-8"?>
<response:response xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:mcs="http://www.volantis.com/xmlns/2006/01/xdime/mcs"
  xmlns:response="http://www.volantis.com/xmlns/2006/05/widget/response">
  <response:head>
    <response:link rel="mcs:theme" href="/main.mthm"/>
  </response:head>
  <response:body>
    <response:carousel id="myWeatherCarousel">
      <li><a href="http://www.budapest.hu">Budapest</a>: 22°C, rain and wind</li>
      <li><a href="http://www.prague-city.cz">Prague</a>: 8°C, rain</li>
    </response:carousel>
  </response:body>
</response:response>

Related topics