I'm just wondering if there is any data binding system like the one
Adobe Flex has on Xul framework?
It's a function woking like a binding between some data model and a
value of an user interface control, and the model is automatically
updated by observing a value of a control.
Thank you,
Nori
Hello Nori.
Well, I think RDF templates does something like that but... I don't
like RDF. I just ended by develop my own binding facility (based on
Beans Binding, used with SAF - Swing Application Framework). Actually
it's not open and not even is ready for use, but it was pretty simple
to develop. You just wrap the controls exposing a common interface
(getValue and setValue in my case) and also a language for binding
(something like EL - Expression Language, also from Java world).
I hope that it helps.
Davi
PS. Sorry for the english
Thank you for replying to me.
You mean you are talking about XBL, right?
I know XML, but what I wanted to know is a binding of a value of some
component and some data model object.
For example, I would like to bind a value of a text box which is
already present as a XUL component and some data object.
I think we are talking about a different issue.
Yeah, XUL is using a word 'binding' for XBL, so it's a kind of
complecated, but I'm not talking about XML.
Anyway, thank you for the reply.
Nori
No no. We are talking about the same thing. And I am talking about RDF
templates (not XBL).
Please see: https://developer.mozilla.org/en/rdf_in_mozilla_faq
Im my app, I wrote a library to do the data binding (I'm not using RDF
templates). I have a variable called registry:
var registry = {
name: null,
phone: null,
married: null.
// and so on...
}
And I have some controls that reflects the data inside this object:
// first you bind controls to the "model"
var b1 = bind("my-control-id-1", "name");
var b2 = bind("my-control-id-2", "phone");
var b3 = bind("my-control-id-3", "married");
var group = new BindingGroup();
group.add(b1);
group.add(b2);
group.add(b3);
// ...
// to update the values and binded controls:
b1.setValue("Davi R. Tavares");
b2.setValue("000 000");
b3.setValue(false);
group.updateControls();
It was quite easy to implement this library, I think you can do so.
Please take a look at RDF templates and Beans Binding specification
(https://beansbinding.dev.java.net/).
Hope it was helpfull.
Davi
It's exactly what I was expecting for!!
Thank you so much. You gave me a quite good idea.
It helped me a lot.
Thanks!!!