Visit Mozilla.org

nsIXFormsModelElement

From MDC

Contents

[edit] Summary

nsIXFormsModelElement is implemented by all XForms <model/> elements. It defines scriptable methods for manipulating instance data and updating computed and displayed values. It is defined in the XForms Specification

nsIXFormsModelElement is defined in extensions/xforms/nsIXFormsModelElement.idl. It is scriptable and has been frozen since Mozilla 1.8.

[edit] Interface Code

[scriptable, uuid(e891d132-46f8-464c-b93b-1fb883fa03da)]
interface nsIXFormsModelElement : nsISupports
{
  nsIDOMDocument getInstanceDocument(in DOMString instanceID);
                                          // raises(DOMException)

  void rebuild();
  void recalculate();
  void revalidate();
  void refresh();
};

[edit] Methods

(documentation text taken from the XForms 1.0 PER Specification)

[edit] getInstanceDocument

  nsIDOMDocument getInstanceDocument(in DOMString instanceID);
                                          // raises(DOMException)

getInstanceDocument returns a DOM Document that corresponds to the instance data associated with the instance element containing an ID matching the instanceID parameter. If there is no matching instance data, a DOMException is thrown.

[edit] rebuild

 void rebuild();

rebuild signals the XForms Processor to rebuild any internal data structures used to track computational dependencies within the given XForms Model.

[edit] recalculate

 void recalculate();

recaĺculate signals the XForms Processor to perform a full recalculation of the given XForms Model.

Note: Script invocation of recalculate() is not necessarily equivalent to performing the recalculate action handler. Though the script is assumed to have modified instance data prior to invoking recalculate(), the DOM mutations are not cached. Thus, a full recalculation is necessary to ensure the proper changes are effected throughout the XForms Model.

[edit] revalidate

 void revalidate();

revalidate signals the XForms Processor to perform a full revalidation of the given XForms Model.

[edit] refresh

 void refresh();

refresh signals the XForms Processor to perform a full refresh of form controls bound to instance nodes for the given XForms Model.

[edit] Related Interfaces

None.

[edit] Example Code

None.