W3C home > Mailing lists > Public > public-appformats@w3.org > November 2006

[XBL] Clarification: addBinding() and the xbl:script element

From: Marcos Caceres <m.caceres@qut.edu.au>
Date: Tue, 28 Nov 2006 16:11:59 +1000
Message-ID: <2515EDBE2C49604E97ACEDCD606748F664ED10@beeex03.qut.edu.au>
To: <public-appformats@w3.org>
The following relates to Section 3.5 - Binding Attachment Model.  Can
you please clarify the following: 

 

If I attach a binding to an element using addBiding() (or using CSS
'-xbl-binding:'),  can I still call functions defined in an xbl:script
element from within the implementation of a binding? The 6 steps defined
in section 3.5 do not specify if xbl:script elements in bounding
documents are evaluated and made available in such situations. For
example, can I do the following: 

 

HTML Doc: 

<html>

<script>

                var b  = document.getElementById("myButton"); 

                b.addBinding(ui.xbl#magicButton); 

</script> 

<...>

 

XBL Doc (ui.xbl)

<xbl>

<script> 

                var count = 0; 

                function counterInc(){ return count++;}

<script>

 

<binding id="magicButton">

                <implementation> 

                ({getNumber: function(){

                                var a = counterInc (); 

                                a = a + "hhhh" + count;

                                return a;

                }, 

 xblBindingsAttached: function(e){

                                alert(this.getInstanceNumber())

}})

</implementation>

</binding>

</xbl> 

 

If I can do the above, then it might be good to state in section 3.5
that the script element is firstly evaluated and made available to
bindings. 

 

Marcos 
Received on Tuesday, 28 November 2006 06:12:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:10:20 GMT