On 10/25/05, Matt Chotin <[EMAIL PROTECTED]> wrote:

I was talking 1.5 for ClassReference, it shouldn't go in BindingManager if you don't have curly braces.  Not sure why it didn't behave for you.


Nope, Still places them inside the binding Manager.....heh found a bug then?

i tried it on a few different classes, and all did the same.. the moment curly braces enter the equation, its _level0.document._bindings. I'm using FAST to inspect the _level0 heirachy and it does show up there aswell as within trace statements i've made...

class com.mossyblog.test extends mx.containers.HBox {
    [ClassReference]
    public var testAttr:Boolean;

}

<mb:test testAttr="{true}"/>



The organization of bindings is different in 2.0 I think, but in any case we have no intention of that stuff being exposed for other purposes so I wouldn't count on us changing anything for you here J

So, (probably not the forum for this) the chances of us getting source for FLEX 2.0 framework is ummm... not likely? I say this as i've often relied on the frameworks source to help reduce verbose MXML to simplistic ones... by using MXML tag to do one or more things at once..


 

Glad you liked the accent, trying to offend as many Aussies as possible, Pete Farland almost cried in pain J


Its not that bad, could be worse, Steve Irwin style umm..thats even painful for aussies... we don't all sound like that, and of course i personally prefer to stage dive onto great white sharks, where as others prefer crocs... thats of course after we overcome our fear of not being allowed to jump into kangaroo pouches when we are little ;) ...damn, if i only could of worked in "throw a shrimp on the barbe" in there somehow...


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Scott Barnes
Sent: Monday, October 24, 2005 9:49 PM


To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: BindingManager and Properties interogation.. (Flex 1.5)

 

 

On 10/25/05, Matt Chotin <[EMAIL PROTECTED]> wrote:

If you want to ensure that the class gets linked but is available at creation up you can use [ClassReference] as the metadata on the property of your component and we'll link it in so that you don't have to use bindings.  That should give things to you a little earlier.

 

[ClassReference]

var monkeyClass:Object;

 

Then when you startup look if monkeyClass is a Function (you're done) or String (pray that it was linked).  But binding becomes unnecessary.  If you always want the class reference you could of course type your variable as Function.

So this is all in FLEX 2.0 yeah? not for 1.5.. ie 1.5 seems to do a parse where it seperates complex attributes from simple, if complex store in binding manager else show in obj.properties..
 

 

Flex 2 will allow you to say that a variable should be of type Class.

Yeah, haven't had the chance this week to jump back into 2.0, but will revisit this then :) heheh.

 

Is this enough or do you still need the binding stuff later? 

Personally, i'd like the binding manager to represend its bindings in a "Struct/hashmap" rather then keys havin dot.notations.. in that, if the following exists:

<oe:myCustomTag id="monkey" attr1="{true}" attr2="{false}" attr3="{ref.to.class.path}"/>

Then inside document._bindings it would look like this:

document._bindingsByDestination["monkey.attr1"]
document._bindingsByDestination["monkey.attr2"]
document._bindingsByDestination["monkey.attr3"]


Rather then.
document._bindingsByDestination.monkey["attr1"]
document._bindingsByDestination.monkey["attr2"]
document._bindingsByDestination.monkey["attr3"]

Not sure, but to me the later sounds more optimal as then you could kill a branch, rather then forloop text pattern searching?

Yeah, the deferred instantiation structure to work with binding and all that jazz was pretty insane.  Almost every engineer on the app model was involved in it somewhere J

Anyone who says the FLEX Engineer team are hacks, umm deserves a big ol fashion "slap with a trout" ;) i'm impressed anyway, now i have to relearn everying for FLEX 2.0... geez...hopefully there is some transfer there in terms of logic that i can leveridge (ie i'm hoping its not too radical in change of framework).

Thanks Matt.
(P.S... nice Aussie Accent at MAX btw.. it was disturbing heh)
 

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Scott Barnes
Sent: Monday, October 24, 2005 4:54 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: BindingManager and Properties interogation.. (Flex 1.5)

 

Hi Matt,

On 10/25/05, Matt Chotin <[EMAIL PROTECTED]> wrote:

Well in this particular example you know that cellRenderer doesn't need to use a binding _expression_, it can be done as a string and we know that CellRenderers are usually classes so we do a lookup?

I should of used a different naming for my attribute. I've created my own MXML tag *component* that in a nutshell does one or more things (rather then occupying verbose XML, i decided to consolidate a few concepts to less tags, resulting in part-instruction, part-creation).

Anyway, the concept is that if i can insert my own attribute within a tag, that has "class signatures" (if thats the correct term), the compiler will also include these classes at compile time... ie if i make no reference to "com.mossyblog.monkey" anywhere but:

<oe:myTag monkeyClass="{ com.mossyblog.monkey }"/> then essentially i'm not only "importing" this class auto-magically, but i'm also setting this tag up to use createClassObject( monkeyClass ) style approach aswell. If i go by using string, then I'll have to assume that somewhere else, this class was imported correctly... figured we are in MXML, why not fly by the seat of our pants hehe.
 

 

But assuming the issue still needs to be solved bindings tend to get assigned right before the initialize event of the component fires.  I don't remember if the document._bindings will even be instantiated by the time createChildren is called on the document, though it might be.  It


It does. The moment mx:Application container gets constructed, we have document._bindings. I've stepped through the frameworks instantiation process overall, and man, how you guys sat down and wrote this framework is amazing (heh, i mean that in terms of, some smart ideas put into play to reduce memory).

I've simply resigned myself to the fact that inside each class, is a variable that has "knownBindingPropertiers" or whatever you want to call it, and it simply cycles through these properties and looks for this._document._bindings[this.id + "." knownBindingProperties[i]]._srcFunc() for the value(s) i need in order to createClassObject or createChild/createComponent.

I've not yet checked to see how FLEX 2.0 framework does the overall construct, but hopefully there is similiar routines in play? ....hopefully...

 

could happen while the app itself is going through its initialize phase and the bindings will be assigned later.  So unfortunately the answer is no, no great way of reliably determining what properties will be assigned into you before you are constructed.

 

The getUIComponentWatcherForDestination is to make the validation errors work correctly, it isn't going to provide what you need.

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Scott Barnes
Sent: Sunday, October 23, 2005 10:09 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: BindingManager and Properties interogation.. (Flex 1.5)

 

Just to add more perspective to this.

I basically want to have the ability to provide an array of some sort, that will turn off binding for a given property and simply add it to a containers properties.

At present if you did cellRenderer="{ whatever  }", that argument wouldn't show up in obj.properties list, unless its a simple string value. It instead gets placed in document._bindings. What i'm trying to do is remove this out of bindings (that or find some way to get information on all known attributes provided within MXML and their values at createChildren())

So far, the only way i can see this being done is to look in two parts, obj.properties and look in obj.document._bindings or obj.document._bindingsByDestination[dest]...

Catch22, is if i do this, i have to *know* all potential properties being passed into a custom MXML components (maybe a simmiliar mergeProperties array maybe?

Anyway, anyone within MM or in this list had much experience with MXML tags and how to intercept various routines before construct commences, i'd greatly appreciate it.

On 10/24/05, Scott Barnes < [EMAIL PROTECTED]> wrote:

Heyas,

I've been wanting to basically access a property on a MXML tag thats not "string", ie cellRenderer="{ com.mossyblog.myRenderer }" before "createComponent" is executed. In that, i want to firstly determine what the renderer is and based on this, delegate that instantion elsewhere.

Now, on first pass i noticed that the moment you place "{}" within an argument, BindingManager basically takes that and treats it as a "binding". How does one ask the BindingManager for that reference at say "createChildren"?

Is it a matter of:

mx.managers.BindingManager.getUIComponentWatcherForDestination(this, this.id )

--
Regards,
Scott Barnes
http://www.mossyblog.com




--
Regards,
Scott Barnes
http://www.mossyblog.com


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com


YAHOO! GROUPS LINKS

 

 





--
Regards,
Scott Barnes
http://www.mossyblog.com


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



YAHOO! GROUPS LINKS

 

 





--
Regards,
Scott Barnes
http://www.mossyblog.com


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS






--
Regards,
Scott Barnes
http://www.mossyblog.com

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to