Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

AjaxUpdateContainer

AjaxUpdateContainer is a particularly cool component that allows any component on your page to be refreshed in the background without a full page refresh. AjaxUpdateContainer uses a WOComponentContent. All content between its webobjects tags will be refreshed when it is ordered.

...

A series of demos of AjaxUpdateContainer is available in the AjaxExamples project in Project Wonder.

Wonder Bindings

  • id (required) - the ID of the generated HTML element that will contain your content
  • elementName - the HTML element name of the container ("div" or "span", defaults to "span")
  • observeFieldID - This provides support similar to the observe_field helper on Ruby on Rails. The value of observeFieldID should be the id of the form element you want to observe (for instance, set the id = "Something" on a WOTextField and set observeFieldID = "Something"; on your update container). When the field changes, this will cause the field you were watching to submit its new value and the update container will refresh. This allows you to do things like dependent WOPopUpButtons where one popup button changes, causing the second popup button to refresh with new values. I've only tested this where both are in the same form.

Prototype Bindings

Prototype Documentation

  • frequency - when specified, the update container will automatically periodically refresh at this rate (in seconds)
  • decay - if the container updates and the contents do not change, slow down the rate of update by this factor each request
  • evalScripts - whether or not script tags should be evaluated when the container updates
  • insertion
  • onComplete
  • onSuccess
  • onFailure
  • onException

...