Question

I am having an issue with the collectionChanged event being fired when a transient property of a DTO is changed. I have a custom ComboBox, which has a CheckBox itemRenderer for each row, that stays open till the user moves focus away from it. The dataProvider is an ArrayCollection of FooDto. I want to be able to toggle the visible propery of the FooDto, but stop the ComboBox from closing due to the dataProvider being altered.

[Bindable]
class FooDto {
  public var id:int;
  public var name:String;
  [transient]public var visible:Boolean;
}
Was it helpful?

Solution

The [Transient] metadata is to prevent a property from being serialized when you send it to a server. It will not prevent a property from being bindable.

I would suggest that you create a method setVisible() instead of using a property. If you then set a private variable, this will not trigger a collection change. You could also make each property in FooDto bindable except the "visible" property.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top