XBL Encapsulation Issue

A binding that I am developing has various properties. Some of the properties have side effects when setting them like the disabled property for html:form elements. Because of this, setting the property must be done through a setter, and the property must not be accessible to the outside by any other means. The properties are not associated with any anonymous content nor with any CSS properties. They are just properties of the JS object and do not appear in the DOM.

I coded up the following example to illustrate the issue I am having. I try to define a property called visible and then I create getters and setters for that property. The constructor and getter/setter reference this.visible, but this causes the error: too much recursion. To get around this, I created an alternate "hacked" binding that uses this._visible to store the state when the visible property is get or set. However, doing this results in _visible being publicly accessible without having to go through the getter/setter. (Remember, this is just an illustration. Storing the visibility state in the style.visibility property is not the answer as the binding I am developing does not have such properties.)

Any input you have would be appreciated. The bindings are located in testcase.xml.


Which binding to use:

BBall


Weston Ruter