actionscript 3 - flex databinding with selectedItem property of the combobox update many times problem -


OK, I have a combo box, in which I have built my selected item property in a value object object, such as <

& lt; Fx: binding source = "styles_cb.selectedItem.toString ()" destination = "_reserve.style" /> & Lt; Fx: Announcements & gt; & Lt; Fx: XML id = "config_xml" xmlns = "" source = "config.xml" /> & Lt ;! - Place non-visible elements (for example, services, value objects) - & gt; & Lt; / Fx: Announcements & gt; & Lt; Mx: combo box x = "66.15" y = "63.85" editable = "wrong" id = "styles_cb" datasaver = "{config_xml.styles.style}" />

Value object is a custom class with some sets and gesters, and I want to set a property based on the value of the selected item of the combo, so in the value object, The public function set style (value: string): zero {_style = value; Trace (value); }

My problem is that every time I change the combobox selection, which actually changes the value property's property property, it does 3 times, if I center the value Actually find trace 3 times, why ?? How can I avoid this? Am I doing something wrong?

This is normal for data, or is there a better way to do this, please help, someone Also thanks for the help

Binding expression is a fire for more than one relatively many times. I do not know the right reason if this is the cause of the problem for your app, do not force the source directly, instead use the invalidation Bind the source to set a flag, styles selected ITemChanged and invalid papers call DO (). Then override commitProperties () and your commitProperties (), check whether the styles selected is ITemChanged truth, and if so, then forward the new value to the destination and reset the flag to the flag. Be sure to call supercompetent properties () too, or many things will be broken.

Invalidity in Flex Framework is very common, each component uses it internally, and it helps a lot with these types of issues.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -