Comments (26)
A two in one report.
1. Flex apparently looks at the declared type of the bindable reference for
binding information. In your case IMap (second check box) does not provide any
bindable properties and is therefore ignored. If you switch your initializer to
"preinitialize", the check boxes are selected properly. But this is not what
you want, is it?
2. You are right, the Fx collections do not have binding tags at all. You may
catch change events with pure ActionScript approach (addEventListener). I will
consider your feature request in the next bigger update.
Original comment by [email protected]
on 16 Mar 2011 at 5:46
from as3-commons.
Original comment by [email protected]
on 16 Mar 2011 at 5:53
- Changed state: Accepted
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from as3-commons.
Original comment by [email protected]
on 16 Mar 2011 at 5:54
from as3-commons.
Thanks for your reply. Yes, i just want to use the inner binding mechanism to
get the view updated. I think add the Bindable metadata tag in IMap is a good
idea no matter the instance is Map or MapFx. When I bind to IMap and
instantiate a MapFx, I just think the data binding should work because I do not
instantiate a Map.
Original comment by [email protected]
on 17 Mar 2011 at 9:19
from as3-commons.
[deleted comment]
from as3-commons.
A work-around for the problem is to create a sub-interface of IMap which is
annotated with [Bindable], like:
[Bindable]
public interface IMapBindable extends IMap{
}
In addition you need a subclass of Map that dispatches a PropertyChangeEvent
whenever the map changes.
As long as you declare the variable of type IMapBindable the bindings will work.
Original comment by [email protected]
on 25 May 2011 at 4:32
from as3-commons.
https://github.com/AS3Commons/as3commons-collections/wiki/Roadmap-1.4
Original comment by [email protected]
on 26 May 2011 at 8:11
from as3-commons.
Hey Guys are you able to fork the project on GitHub, perform changes and submit
a pull request?
Original comment by [email protected]
on 26 May 2011 at 8:21
from as3-commons.
Finished.
https://github.com/hydra1983/as3commons-collections
I just implemented everything including in my patch.
Original comment by [email protected]
on 27 May 2011 at 3:19
from as3-commons.
Where's the bindable-tag?
https://github.com/hydra1983/as3commons-collections/blob/master/src/org/as3commo
ns/collections/framework/IMap.as
Original comment by [email protected]
on 27 May 2011 at 7:42
from as3-commons.
Here :-)
https://github.com/hydra1983/as3commons-collections/blob/master/src/org/as3commo
ns/collections/framework/IMapFx.as
Original comment by [email protected]
on 27 May 2011 at 7:45
from as3-commons.
You need on IMap as well, there's no sense in IMapFx being Bindable and IMap
not. Also, the bindable-tag is to be placed on everything which value's might
change due to the collectionChange-event.
You need to place it on itemFor as well.
Original comment by [email protected]
on 27 May 2011 at 7:51
from as3-commons.
Each of the collections comes in two versions: A plain and a bindable. The
reason is simply performance. The majority of use cases utilize non-bindable
versions.
Original comment by [email protected]
on 27 May 2011 at 7:59
from as3-commons.
Ah, that's fine. I still want the bindable-tag on itemFor though.
Original comment by [email protected]
on 27 May 2011 at 9:23
from as3-commons.
[deleted comment]
from as3-commons.
..since I want to do this:
<mx:Label text="{myMap.itemFor('foo')}"/>
And myMap is populated by some asynchronous call.
Original comment by [email protected]
on 27 May 2011 at 10:37
from as3-commons.
latest solutions:
#remove IMapFx and IDuplicatesFx
#set [Bindable("collectionChanged")] for IMap and MapFx methods:
* function hasKey(key : *) : Boolean;
* function itemFor(key : *) : *;
* function keysToArray() : Array;
#set [Bindable("collectionChanged")] for IDuplicates and MapFx methods:
function count(item : *) : uint;
Original comment by [email protected]
on 27 May 2011 at 12:46
from as3-commons.
I think Jens want the IMap-interface free of bindable-tags for performance.
Looks like you guys got this under control, looking forward to the next release.
Original comment by [email protected]
on 27 May 2011 at 1:07
from as3-commons.
Is there actually any performance hit if no one is binding to those methods?
Certainly the implementation that supports binding will be less performant as
it is dispatching events on changes, but I don't see how Binding tag on IMap
interface actually is affected.
Original comment by [email protected]
on 27 May 2011 at 1:51
from as3-commons.
If no one is binding to the methods, they don't need to be bindable in the
first place.
If you're going to support data binding, Flex goes through all methods
annotated with Bindable when the event is dispatched and look for clients.
See this article on data binding issues:
http://www.screenshot.at/blog/2009/04/18/databinding-under-the-hood-part-1-perfo
rmance/
And google "dive into data binding waters" for another presentation on the
implementation on data bindings.
Original comment by [email protected]
on 27 May 2011 at 2:12
from as3-commons.
@hydra do you mind to check the updated versions using this performance check
tool?
http://code.google.com/p/sibirjak/source/browse/trunk/#trunk%2Fasperform%2Fcom%2
Fsibirjak%2Fasperform
It should be not more effort than just replace the as3commons collections
version.
Original comment by [email protected]
on 27 May 2011 at 2:29
from as3-commons.
So, it's better to create a separate IMapxFx interface to support data binding
and keep the unbindable IMap?
By the way, I looked into
com.sibirjak.asperform.collectiontests.CollectionTests, shoud I run all the
tests?
How can I know there is no performance problem with the updated version?
Original comment by [email protected]
on 28 May 2011 at 7:57
from as3-commons.
this is the performance test results. I run it with flash builder with sdk 3.5
and have -debug set to false.
Original comment by [email protected]
on 28 May 2011 at 8:02
Attachments:
from as3-commons.
the results are from the execution of "AS3CommonsTests"
Original comment by [email protected]
on 28 May 2011 at 8:04
from as3-commons.
Original comment by [email protected]
on 12 Sep 2011 at 6:14
- Added labels: SubProject-ui
from as3-commons.
Original comment by [email protected]
on 12 Sep 2011 at 6:14
- Added labels: SubProject-collections
- Removed labels: SubProject-ui
from as3-commons.
Related Issues (20)
- File is broken after re-saving it HOT 3
- No match for Opcode: 0xbb (187) HOT 3
- Error #2030: (EOF) HOT 3
- Error #1125: The index 1073741823 is out of range 210 while reading file HOT 3
- [Feature Request] HOT 4
- Vector class name truncated
- Type Coercion failed: Array to Vector.<Op> and Array to Vector.<JumpTargetData> HOT 2
- Invalid parsing of string operand when defining method body from source string.
- Error #1034: Ошибка типа Coercion: невозможно преобразовать org.as3commons.bytecode.abc::Multiname@af8a541 в org.as3commons.bytecode.abc.QualifiedName.
- Can't create class members of type Vector.<T>
- Class org.as3commons.logging::ILogger could not be found. HOT 1
- Bug in log4j configuration HOT 1
- equals and equalsIgnoreCase are both using regex improperly HOT 1
- Chainsaw gateway generates malformed XML
- ArrayUtils.shuffle algorithm results in a biased shuffle HOT 1
- NPE when ByteCodeType.fromLoader is invoked in an empty Application HOT 1
- MethodBuilder.addAsmSource() #1034 conversion error
- On method body definition, #1065 error accessing private or protected property
- Ability to get abcBytes position from DoABC tag
- as3commons-bytecode - issue creating metadata against accessors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from as3-commons.