I subclassed the Combo as I have no real idea of what the grids will 
be like.

Actually after thinking about the ClassFactory for a while, its such 
a trivial class I decided to make life a bit simpler and have my 
subclassed Combo implement the IFactory interface so that it is its 
own ClassFactory making it easier to access any properties of the 
Combo.

I then added an event on the Combo that gets fired so that the 
DataGrid can be configured before newInstance returns.

A also added a dataGrid property so that the dataGrid can be defined 
in the mxml as a child tag of the Combo.

I couldnt figure out how to make the descriptor angle work as I want. 
What I wanted was to have the Combo create a descriptor from the 
child tag but not an instance of a child "DataGrid" tag, then I would 
grab the descriptor during newInstance a build a new DataGrid... 

But I couldnt figure out how to stop it creating an instance of the 
DataGrid from the child tag during the Combo's instaniation. I can 
see that Containers can do that but it seemed to me that you need to 
be a "container" to get any control over what happens with a child 
component descriptors otherwise the parent container builds the Combo 
and sees the Combo's child tag and creates the DataGrid without 
checking with the Combo.






Unrelated but this looks like a bug in Combo in 2 but fixed in 3 
(well the code looks different). 
The dropDown open/close behavior...

Works fine as normal:
slide down to open, slide up to close.

Shorten the browser window height so the drop down wont fit in the 
down direction but can fit in the upwards direction so now it opens 
up:
slide up to open, slide down to close.

Now resize the window again so that it can now drop down:
slide down to open and slide DOWN to close..

i.e. it closes by moving further away from the Combo not back towards 
it...

Looks like the variable tweenUp gets set to true and never reverts to 
false, during open its ignored as a factor in determining direction 
but on close it is used as a factor in determining the direction, so 
close direction is wrong.


--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> 
wrote:
>
> There should be a UIComponentDescriptor in a .descriptor property 
on any
> UIComponent instantiated by MXML.
> 
>  
> 
> I would probably subclass ComboBox, and have it assign itself to the
> dropdownFactory.
> 
>  
> 
> However, if you don't want to do that and know what properties you 
want
> to steal, I would subclass DG and steal it in commitProperties from 
its
> .owner property and not bother with the UIComponentDescriptor  Some
> things like labelField are passed down for you.
> 
>  
> 
> ________________________________
> 
> From: [email protected]
> [mailto:[EMAIL PROTECTED] On Behalf Of reflexactions
> Sent: Tuesday, December 04, 2007 9:40 PM
> To: [email protected]
> Subject: [flexcomponents] Re: ComboBox with a dropdown DataGrid
> 
>  
> 
> Ah yes, I can create a custom ClassFactory.
> I "could" pass a reference to the Combo into the custom 
ClassFactory 
> so it could read custom properties off the Combo at run time, and 
> also fire an event to allow the devs to customise the Grid before 
it 
> is passed in to the Combo in getDropDown.
> 
> In theory I would think (though I dont know how) it is possible to 
> have it read a descriptor from the Combo and instantiate a grid 
based 
> on the descriptor. The descriptor being some tags set in the mxml?
> 
> --- In [email protected]
> <mailto:flexcomponents%40yahoogroups.com> , "Alex Harui" <aharui@> 
> wrote:
> >
> > You would use a custom factory or the properties bag in 
> ClassFactory to
> > customize the grid. The combo's dropdown can get destroyed and
> > re-created in certain situations which is why we use a factory 
and 
> you
> > shouldn't count on mucking with the dropdown property always 
> working.
> > 
> > 
> > 
> > ________________________________
> > 
> > From: [email protected]
> <mailto:flexcomponents%40yahoogroups.com> 
> > [mailto:[email protected]
> <mailto:flexcomponents%40yahoogroups.com> ] On Behalf Of 
reflexactions
> > Sent: Tuesday, December 04, 2007 9:12 PM
> > To: [email protected]
> <mailto:flexcomponents%40yahoogroups.com> 
> > Subject: [flexcomponents] Re: ComboBox with a dropdown DataGrid
> > 
> > 
> > 
> > Thanks Alex good to know, 
> > Actually thinking about it at least for the simple case you are 
> > right, I saw I could set the factory property but then discounted 
> > that as there didnt seem to be anyway to configure the dropDown 
> once 
> > the instance is created becuase getDropDown is private. However 
at 
> > least for a simple grid it can be built directly from the 
> > DataProvider without any extra configuration
> > I sort of feel however that this probably wont be enough because 
I 
> > know that in this application/system the grids generally have a 
lot 
> > of custom formats, so I am gussing that there would need to be 
away 
> > to specify the grid structure.
> > 
> > --- In [email protected]
> <mailto:flexcomponents%40yahoogroups.com> 
> > <mailto:flexcomponents%40yahoogroups.com> , "Alex Harui" 
<aharui@> 
> > wrote:
> > >
> > > All you should need to do is change dropdownFactory. I wouldn't 
> > have
> > > said I did it if I had to monkey-patch anything.
> > > 
> > > 
> > > 
> > > ________________________________
> > > 
> > > From: [email protected]
> <mailto:flexcomponents%40yahoogroups.com> 
> > <mailto:flexcomponents%40yahoogroups.com> 
> > > [mailto:[email protected]
> <mailto:flexcomponents%40yahoogroups.com> 
> > <mailto:flexcomponents%40yahoogroups.com> ] On Behalf Of 
> reflexactions
> > > Sent: Tuesday, December 04, 2007 8:58 PM
> > > To: [email protected]
> <mailto:flexcomponents%40yahoogroups.com> 
> > <mailto:flexcomponents%40yahoogroups.com> 
> > > Subject: [flexcomponents] Re: ComboBox with a dropdown DataGrid
> > > 
> > > 
> > > 
> > > Hmm well..
> > > 
> > > Basically as Shannon says... 
> > > They want more than just a fancy label format can handle, 
plus.. 
> > > plus...
> > > Also to some extent "mines not to reason why", I just build it..
> > > 
> > > Actually it doesnt seem that difficult to do barring the usual 
> > issue 
> > > in extending Adobe components that just about every property 
you 
> > need 
> > > to access has been declared private.
> > > CombBox by and large deals in ListBase and Grid derives from 
> > > ListBase, just _dropdown and getDropdown are private so I will 
go 
> > the 
> > > AbjectOrientated approach and cut and paste ComboBox into a new 
> > class 
> > > and then modify those bits.
> > > Probably will make the dropDown a public property so the grid 
> > > definition can be nested in combo tag or allow it to be built 
> > > externally and then set.
> > > Anyway those are just my thoughts of the top of my head...
> > > 
> > > 
> > > --- In [email protected]
> <mailto:flexcomponents%40yahoogroups.com> 
> > <mailto:flexcomponents%40yahoogroups.com> 
> > > <mailto:flexcomponents%40yahoogroups.com> , "ben.clinkinbeard" 
> > > <ben.clinkinbeard@> wrote:
> > > >
> > > > Not that I know of but I have to ask- why would you want to 
do 
> > that?
> > > > 
> > > > 
> > > > --- In [email protected]
> <mailto:flexcomponents%40yahoogroups.com> 
> > <mailto:flexcomponents%40yahoogroups.com> 
> > > <mailto:flexcomponents%40yahoogroups.com> , "reflexactions"
> > > > <reflexactions@> wrote:
> > > > >
> > > > > Before I reinvent the wheel has anyone tried this?
> > > > > 
> > > > > tks...
> > > > >
> > > >
> > >
> >
>


Reply via email to