Hi Lars,
can you please provide me a playground example ?
It will make it easier to understand and debug your code.
Regards,
Romeo
Von: [email protected] [mailto:[email protected]]
Gesendet: Mittwoch, 21. August 2013 10:53
An: [email protected]
Betreff: [qooxdoo-devel] Bidirectional Data Binding for custom widget with
CheckBox and TextField
Hi,
I am implementing a small mock-up application having two lists
(qx.ui.form.List) synchronized
with an data array (qx.data.Array) via controller (qx.data.controller.List). I
have implemented a
class representing a custom widget, which holds a qx.ui.form.CheckBox and a
qx.ui.form.TextField.
The class outline of the custom widget is analogous to the example in the
qooxdoo tutorial found
in the qooxdoo manual 3.0, chapter 4.7. The special thing about my application
is that both lists
should be bound bidirectionally, so when I change a checkbox or the content of
a textfield in list 1,
this will change the corresponding value in data model (containing the two
properties "value" and
"text", equipped with events) and also the corresponding checkbox or textfield
in list 2.
I have tested my application using a simple qx.ui.form.CheckBox and binding to
the properties "value" and
"label", which works just fine. For the bidirectional binding I have used the
methods bindProperty and
bindPropertyReverse inside the delegate of both controllers (I use one
controller for binding the model
to list 1 and another controller for binding the model to list 2).
I have also tested my application using the unidirectional binding only
(bindProperty method of controllers),
which also works, although the checkboxes are not editable and there is an
error message on the console
saying:
"Uncaught TypeError: Object [object Object] has no method 'getLabel'..."
This seems partly logical to me, since I only have defined unidirectional
binding.
However, using the method bindPropertyReverse in my bindItem function of my
delegate results in the following
error on my browser console (listsync.ListItem is my custom widget):
"Uncaught Binding property value of object listsync.ListItem[73-0] not
possible: No event available. : error..."
It would be great, if someone could help me in this matter. Really looking
forward to your responses.
best,
L.
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel