thanks guys, tim i do agree with your pseudo-rant- there are just too many things in flex that should be easy or 'no-brainers'. This being a perfect example. Flex is awesome, make no mistake, but I think enough people do this sort of technique to build it in to the framework- hopefully for next version. Working with forms is another process I would love to see refined for the next version but I'm getting off topic.
yeah i noticed that 'prompt' actually goes away when you select another option- so I put a button next to the cbo to set it to selectedIndex = -1 which works but is ugly. alex i'll try to follow your example. d. On Tue, Nov 4, 2008 at 2:22 PM, Tim Hoff <[EMAIL PROTECTED]> wrote: > > Yeah, it wasn't personal Alex. I guess I just felt like giving some > commentary/feedback from the developer point of view. Sorry if it was > taken the wrong way. > > > -TH > > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, Alex > Harui <[EMAIL PROTECTED]> wrote: > > > > Hmm. What prompted that? > > > > My blog has this post: > http://blogs.adobe.com/aharui/2008/03/custom_ilists_combobox_prompts.htm\ > l<http://blogs.adobe.com/aharui/2008/03/custom_ilists_combobox_prompts.html> > > > > > Most of my posts I hope are like pre-mixed dough. It gets you most or > all of the way there, I think. > > > > From: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com> [mailto: > flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>] > On Behalf Of Tim Hoff > > Sent: Tuesday, November 04, 2008 1:00 AM > > To: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Re: adding (none) option to comboboxes > > > > > > Just subclass. > > > > With all humble respect, most developers do not have the time, and > sometimes the ability, to extend the framework quickly to meet simple > requirements like this. I say this only to point out the different > perspectives between a flex framework engineer and an average or > beginner flex developer. Sure, the power of flex is that you can always > roll your own; when necessary. All for that!!! The problem though, is > that this may be too much to ask from a developer with a deadline. > Before flex, I came from the Microsoft camp. I absolutely appreciate the > freedom that flex affords, to extend the framework and/or create > components from scratch. But, the built-in properties and styles that > flex offers is not quite as comprehensive as what I was previously used > to. That being said, I'd love to see the best of both worlds in the next > generation of! flex. I guess it boils down to the budget and scope of > each release of flex. Of course, the framework can't account for every > possible use-case. However, there are quite a few common functions and > styles, that could be considered to be included. I've had to do > something like "all" or "none" many times with a ComboBox. For a cleanly > coded application, I'd much rather just be able to set a property, like > prompt (but more like reset), instead of adding a sub classed control or > hacking a solution through the dataProvider. Just .02 and a pseudo rant. > :) > > > > -TH > > > > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, Alex > Harui aharui@ wrote: > > > > > > An example of such on my blog > > > > > > From: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>[mailto: > flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>] > On Behalf Of Tim Hoff > > > Sent: Monday, November 03, 2008 2:08 PM > > > To: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com> > > > Subject: [flexcoders] Re: adding (none) option to comboboxes > > > > > > > > > Hi Derrick, > > > > > > The ComboBox prompt will not solve your problem here. It only > appears > > > when the selectedIndex==-1; Unless you want to subclass ComboBox, > > > you're going to have to add "none" to the dataProvider, and > implement > > > custom logic to account for it. Since you're using the same > > > dataProvider elsewhere, I suggest that you use the object utility > copy > > > function, to make a deep copy of the collection; to be used for the> > ComboBox with "none" added. > > > > > > -TH > > > > > > --- In > flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com><mailto: > flexcoders%40yahoogroups.com <flexcoders%2540yahoogroups.com>>, > "Derrick Anderson" > > > no.way.this.is.in.use@ wrote: > > > > > > > > nevermind, i discovered the 'prompt' property :) > > > > > > > > On Mon, Nov 3, 2008 at 3:04 PM, Derrick Anderson < > > > > no.way.this.is.in.use@ wrote: > > > > > > > > > hi, i know this is probably a simple question- but what's the > best > > > way of > > > > > adding a (none) label to a combobox. i have a setter for the > > > dataprovider > > > > > where I add an option for (None) in the list, but I don't > actually > > > want it > > > > > in the dataprovider if that makes sense. Basically, I want > (None) to > > > always > > > > > be a selectable item in comboboxes, but I don't actually want to > put > > > that > > > > > option in the arraycoll! ection combobox dataprovider. here is > the > > > setter for> & gt; > the combobox dataprovider > > > > > > > > > > public function set segmentList(list:ArrayCollection):void > > > > > { > > > > > _segmentList = list; > > > > > var item:DataSegmentVO = new DataSegmentVO(); > > > > > item.dataSegmentID = 0; > > > > > item.dataSegmentName = '(None)'; > > > > > > > > > > if(_segmentList[0].dataSegmentID != 0) > > > > > _segmentList.addItemAt(item,0); > > > > > > > > > > > > > > > dispatchEvent(new Event("segmentsChanged")); > > > > > } > > > > > > > > > > the problem is that same segmentList arraycollection is used in > the > > > place I > > > > > manage segments, and it puts a (none) option in there and it > doesn't > > > make > > > > > sense there. > > > > > > > > > > thanks, > > > > > derrick anderson > > > > > > > >! ; > > > > > > > > >