Open main menu

CDOT Wiki β

Changes

XBL

131 bytes added, 12:03, 6 October 2006
How Does XBL Work?
=What is XBL?=
XBL stands for eXtensible Bindings Language, which is an XML language that is used for declaring the behavious behaviours of XUL widgets. Bindings can be attached to elements using either cascading stylesheets or the document object model. The element that the binding is attached to, called the bound element, acquires the new behavior specified by the binding.
=What Does XBL Do?=
:::[[Image:Xbl_model.gif|http://www.mozilla.org/docs/xul/xulnotes/xbl_model.gif]]
:::[http://www.mozilla.org/docs/xul/xulnotes/xbl_model.gif http://www.mozilla.org/docs/xul/xulnotes/xbl_model.gif]
::Within a XUL file, classes of elements are skinned with the definitions in the CSS file. However the definitions in the CSS file are just pointers to the bindings in the XBL. Bindings that are used to give the elements functionality or perhaps add or make change in their property.  ::The design pattern used is '''indirection (Delegation pattern) ''' where one object relies upon another to provide a specified set of functionality. In this case the CSS file relies on the bindings in the XBL file to provide it with definitions and functionalities for the elements. This makes skinning XUL applications easy. All one has to do is to change the bindings in the XBL file in order to make changes to the behaviour of an element in the application interface.
=What's in a XBL file?=
=Resources/Examples=
==Test Cases==
===Example 1===
[http://developer.mozilla.org/en/docs/CSS:Getting_Started:XBL_bindings XBL bindings Example]
===Example 2===
In this example, we can use XUL to define the layout of user interface and then use XBL to change the widgets functionality. <br/><br/>
1
edit