A XUL element. The following lists attribute and properties common to all XUL elements.
Attributes:
Attributes inherited from Element
Valid on any element that has a datasources attribute. When multiple datasources are used, one may override an assertion from another. This attribute, if true, which is the default, allows a datasource to negate an earlier assertion.
For content generated from a template, this is the XPCOM object that is responsible for generating the content. For scripts its only necessary in case you want to force the template content to be regenerated. You may need to do this if you have adjusted the rules manually. To rebuild the content call the builder's rebuild method.
For example, given a reference to a tree myTree, this example will rebuild its content:
myTree.builder.rebuild();
The style class of the XUL Element. Multiple classes may be specified by separating them with spaces.
Valid on any element that has a datasources attribute. Since RDF holds a graph of resources, it is possible for there to be several pointers to the same node. If this attribute is true, which is the default, duplicate references are skipped. If false, duplicate references will appear.
Should be set to the value of the id of the popup element that should appear when the user context-clicks on the XUL Element. A context-click varies on each platform. Usually it will be a right click.
A space-separated list of datasources that an element's template will use for content generation. These can be either internal datasources such as rdf:bookmarks or a URL of an RDF file. The datasources attribute may be placed on most elements, although it will usually be found on trees and menupopups. The element should have a template element as a child.
The specified datasources are combined into a single composite datasource which holds the data from all of the datasources. This composite datasource is accesssible via a script through the database property.
A unique identifier so that you can identify the XUL Element with. You can use this as a parameter to getElementById and other DOM functions and to reference the element in style sheets.
When an element is in an overlay, the insertafter attribute specifies the id of the element in the base window that the element should appear after. This attribute overrides the insertbefore attribute. This value may be a comma-separated list of ids, which are scanned and the first one found in the window is used.
When an element is in an overlay, the insertbefore attribute specifies the id of the element in the base window that the element should appear before. This value may be a comma-separated list of ids, which are scanned and the first one found in the window is used.
Set to an id of a broadcaster element that is being observed by the element. If an attribute changes in the broadcaster it is also changed in the observer.
Should be set to the value of the id of the popup element that should appear when the user clicks on the XUL Element.
Determines which corner of the popup appears at the anchored position specified by the popupanchor attribute. For example, if the popupanchor is none and the popupalign is bottomleft, the bottom-left corner of the popup is displayed at the mouse position.
This attribute is used to anchor the popup specified by the popup attribute. The position specified determines which corner of the XUL Element the popup appears at. This is necessary for creating buttons with drop down menus.
When an element is in an overlay, the position is an index of which child appears at. The position is one-based, so use a value of 1 to place the element at the beginning. This attribute is ignored if either an insertbefore or insertafter attribute matches an element.
For template generated elements, this attribute is used to specify the root RDF node where content generation begins. This will correspond to the value of an about attribute on an RDF container. This attribute should be placed alongside the datasources attribute.
CSS style rules to be applied to the element. Syntax is as in the HTML style attribute. It is prefered to put style rules in style sheets.
Should be set to the value of the id of the popup element that should be used as a tooltip window when the mouse hovers over the XUL Element for a moment. The tooltip will automatically disappear when the mouse is moved.
For template-generated content, the attribute should be placed on the element where content generation should begin. Thus, it should be placed on an element that is a descendant of a template. The value should be set to rdf:*.
Elements that appear inside the element with the attribute will be repeated for each node in the RDF datasource. Elements outside will appear only once.
JavaScript Properties and Methods:
Properties and Methods inherited from Element
Adds a event listener to an element which listens for broadcast events. It is like adding a new observes element to an element. The two arguments are the equivalent of the attribute and element attributes on an observes element. When the broadcaster given by the element argument has the attribute given by the attribute argument, the broadcast event is fired.
Adds a new event listener for the event specified by type to an element. The type should be the same as the attribute event handler without the word on, for example click or keydown. The listener is the name of a function. If capture is set to true, the event will capture.
If the focus is on the XUL Element, it is removed. The focus is not automatically placed on any other element. Essentially, this is used to call the onblur handler.
This property is available for elements that are derived from boxes, which is most displayable elements. The boxObject contains four properties, x, y, width and height, which can be used to retreive the position of the element. The x and y position is relative to the document's upper-left corner.
Gets and sets the value of the class attribute.
Calls the onclick handler for the XUL Element element.
Returns the composite datasource created when all the datasources of an element are combined. Set to null for elements that do not have a datasources attribute.
Assigns the focus to the XUL Element element, if it can accept the focus. The onfocus handler is called.
Returns an array of all the elements in the document that have the attribute given by the first argument attrib set to the value given by the second argument val. The following example will return all of the checked items in the document.
var elems=document.getElementsByAttribute("checked","true");
Gets and sets the value of the id attribute.
Removes a broadcast listener from an element. Only the listener that is listening to the broadcaster given by the element argument and the attribute given by the attribute argument is removed.
Removes an event listener from an element. The listener specified by the type and listener argument is removed.
Gets and sets the value of the style attribute.