Event when model property has changed in Form controller

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Event when model property has changed in Form controller

woprandi
Hi,

I have a form with 5 checkboxes and the corresponding controller. I'd like to listen when a checkbox value has changed  with a common code (only one generic event which i could get property name and new value instead of write 5 addListener(...)). But it seems not possible, am I right ?
Reply | Threaded
Open this post in threaded view
|

Re: Event when model property has changed in Form controller

halcwb
woprandi wrote
Hi,

I have a form with 5 checkboxes and the corresponding controller. I'd like to listen when a checkbox value has changed  with a common code (only one generic event which i could get property name and new value instead of write 5 addListener(...)). But it seems not possible, am I right ?
I don't think it's that hard. I also had this <a href="http://<a id="nabblelink" href="http://qooxdoo.678.n2.nabble.com/How-to-listen-to-model-change-tp7586702.html">How to listen to model change
<script src="http://qooxdoo.678.n2.nabble.com/embed/p7586702"></script>">question.

So, what you could do is put all the models in an array and iterate over the array adding a single event listener that in turn will raise the model change event, in fact that is how I deal with this. You can then also propagate the new and old data to the 'changeModel' dataevent.
Reply | Threaded
Open this post in threaded view
|

Re: Event when model property has changed in Form controller

woprandi
Yeah I think I don't have a choice and I need to add listener for each property....
Reply | Threaded
Open this post in threaded view
|

Re: Event when model property has changed in Form controller

Mustafa Sak-5
In reply to this post by woprandi
Hi,

IMHO it would be enough to listen to the "changeBubble" event of the model. If you already bound your checkboxes with properties of *one* model, this should be a little.
If your checkboxes have their own models, just push them into a qx.data.Array and listen to its "changeBubble" event.

Gruß
Mustafa Sak

Applications & Integration
1&1 Internet AG | Ernst-Frey-Straße 10 | 76135 Karlsruhe | Germany


-----Ursprüngliche Nachricht-----
Von: woprandi [mailto:[hidden email]]
Gesendet: Dienstag, 3. Februar 2015 10:35
An: [hidden email]
Betreff: [qooxdoo-devel] Event when model property has changed in Form controller

Hi,

I have a form with 5 checkboxes and the corresponding controller. I'd like to listen when a checkbox value has changed  with a common code (only one generic event which i could get property name and new value instead of write
5 addListener(...)). But it seems not possible, am I right ?



--
View this message in context: http://qooxdoo.678.n2.nabble.com/Event-when-model-property-has-changed-in-Form-controller-tp7586764.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Event when model property has changed in Form controller

Tobias Oberrauch
Hi William,

Could you please provide us further details.
Maybe you can paste your use-case into our playground http://demo.qooxdoo.org/devel/playground/#Hello%20World-ria

Which version do you use?

Cheers Tobias
________________________________________
Von: Mustafa Sak <[hidden email]>
Gesendet: Dienstag, 3. Februar 2015 13:03
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] Event when model property has changed in   Form    controller

Hi,

IMHO it would be enough to listen to the "changeBubble" event of the model. If you already bound your checkboxes with properties of *one* model, this should be a little.
If your checkboxes have their own models, just push them into a qx.data.Array and listen to its "changeBubble" event.

Gruß
Mustafa Sak

Applications & Integration
1&1 Internet AG | Ernst-Frey-Straße 10 | 76135 Karlsruhe | Germany


-----Ursprüngliche Nachricht-----
Von: woprandi [mailto:[hidden email]]
Gesendet: Dienstag, 3. Februar 2015 10:35
An: [hidden email]
Betreff: [qooxdoo-devel] Event when model property has changed in Form controller

Hi,

I have a form with 5 checkboxes and the corresponding controller. I'd like to listen when a checkbox value has changed  with a common code (only one generic event which i could get property name and new value instead of write
5 addListener(...)). But it seems not possible, am I right ?



--
View this message in context: http://qooxdoo.678.n2.nabble.com/Event-when-model-property-has-changed-in-Form-controller-tp7586764.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Event when model property has changed in Form controller

woprandi
See this example : http://tinyurl.com/pn69eds
Reply | Threaded
Open this post in threaded view
|

Re: Event when model property has changed in Form controller

Mustafa Sak-5

http://tinyurl.com/qcc7g94

Gruß
Mustafa Sak

Applications & Integration
1&1 Internet AG | Ernst-Frey-Straße 10 | 76135 Karlsruhe | Germany


-----Ursprüngliche Nachricht-----
Von: woprandi [mailto:[hidden email]]
Gesendet: Dienstag, 3. Februar 2015 15:53
An: [hidden email]
Betreff: Re: [qooxdoo-devel] Event when model property has changed in Form controller

See this example : http://tinyurl.com/pn69eds




--
View this message in context: http://qooxdoo.678.n2.nabble.com/Event-when-model-property-has-changed-in-Form-controller-tp7586764p7586770.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Event when model property has changed in Form controller

woprandi
Oh I forgot the param in createModel(). Thanks a lot Mustafa it works !