RE: [flexcoders] Eliminating scrollbars
The first trick is to get the scrollbars to appear on the VBox and not the app. That's the main reason you got clipped. Try this: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute height=300 mx:VBox id=vb width=100% height=100% minWidth=0 minHeight=0 mx:Box id=box width=100% minWidth=0 minHeight=0 height=20 backgroundColor=red borderColor=blue borderStyle=solid borderThickness=8 / mx:TextInput id=boxSize width=100 change=box.height=event.currentTarget.text / /mx:VBox /mx:Application From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Paul Andrews Sent: Friday, November 30, 2007 5:19 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Eliminating scrollbars It's my fault - my post wasn't too explicit. I wasn't particularly thinking of vertical scrollbars. Let's say you had a vertical scrollbar and a width of 100%, this now means you also get a horizontal scrollbar because you can't get the 100% for the component (because of the scrollbar), so a horizontal bar will appear. I really don't want a horizontal bar and depending on content and context I might not have a vertical scrollbar either. So really it's more a case of when you have one scrollbar and don't want two of them! This is the scenario I had in mind: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml layout=absolute height=300 mx:VBox id=vb width=100% mx:Box id=box width=100% height=20 backgroundColor=red borderColor=blue borderStyle=solid / mx:TextInput id=boxSize width=100 change=box.height=event.currentTarget.text / /mx:VBox /mx:Application If you make the box too high, the vertical scrollbar appears and also a horizontal scrollbar. Of course, when the height is small enough there is no vertical scrollbar. I'd like the box width to track the available space so that no horizontal bar appears. The lazy approach with a magic number less than 100% does do the job, but it would be nice to see how others approach this. If I deliberately suppress the horizontal scroll policy, the vertical scrollbar will be over the box, obscuring part of it. Paul - Original Message - From: Giles Roadnight mailto:[EMAIL PROTECTED] To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com Sent: Friday, November 30, 2007 11:09 AM Subject: Re: [flexcoders] Eliminating scrollbars verticalScrollPolicy=off ? On Nov 30, 2007 11:03 AM, Paul Andrews [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I've noticed that in order to eliminate scrollbars on layouts that are percentage based, I'm often choosing magic numbers to avoid the appearance of scrollbars in the layout. Whats the perceived best practice to avoid the generation of scrollbars in layouts? Paul -- Giles Roadnight http://giles.roadnight.name http://giles.roadnight.name
Re: [flexcoders] Re: programatically deselect cells in an AdvancedDataGrid (bump)
Thats what I had hoped would happen too, unfortunately thats not the case with the ADG. Setting selectedIndices to an empty array seems to have no effect on the ADG. It looks like a bug at this point. -superabe On Dec 8, 2007 4:49 PM, David Spurr [EMAIL PROTECTED] wrote: In the standard datagrid (so I assume it's not different for the AdvancedDataGrid as I haven't played with it yet,) you just need to set the selected indices to an empty array. To all select all and select none as a global feature in our app I simply made a DataGridUtil class with static methods of selectAll( dataGrid:DataGrid ) selectNone( dataGrid:DataGrid )
Re: [flexcoders] Re: new to FLEX
Is you using 'server' in the sense of 'web server' or the more generic sense. Given security concerns we can directly access DLLs but does this offer an alternative route to the same functionality? On 12/7/07, markcavins [EMAIL PROTECTED] wrote: How do they store the data? Is it stored server side? --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, dengelwood [EMAIL PROTECTED] wrote: Hi, I am new to FLEX development, but am quite excited about the possiblities of this IDE. Question: My company is using hand held USB bar code scanners to enter user data into one or more text fields. Is it possible in FLEX to capure such scanned data? Anything to point me in the right direction would be helpful. Thanks! rad
Re: [flexcoders] How much can AIR and the OS interact?
Ok...so Flex can't interact with DLLs but another thread (new to Flex) suggests that a possible alternative. lternatively, you can write a server application in C++, Java or C#/.NET that interact with those devices. Whenever the server gets input from the scanner, it forwards that to the Flex application using Sockets. The above comment is talking specifically to a bar code reader app but suggests that there is a way to write something that runs in the context of the given OS that can interact with Flex. It's be very interesting to hear this fleshed out in greater detail. On 12/8/07, hank williams [EMAIL PROTECTED] wrote: I'm looking for an overview: Can AIR apps interact with services running locally? For example, could I create a .net DLL that permitted interaction with the clipboard at the native OS level? No. You cannot access DLLs. Hank
Re: [flexcoders] How much can AIR and the OS interact?
Yes, flash speaks to sockets and so you can communicate with any net accessible object including localhost. So making a local webserver or socketserver is a solution. hank On Dec 9, 2007 7:11 AM, justSteve [EMAIL PROTECTED] wrote: Ok...so Flex can't interact with DLLs but another thread (new to Flex) suggests that a possible alternative. lternatively, you can write a server application in C++, Java or C#/.NET that interact with those devices. Whenever the server gets input from the scanner, it forwards that to the Flex application using Sockets. The above comment is talking specifically to a bar code reader app but suggests that there is a way to write something that runs in the context of the given OS that can interact with Flex. It's be very interesting to hear this fleshed out in greater detail. On 12/8/07, hank williams [EMAIL PROTECTED] wrote: I'm looking for an overview: Can AIR apps interact with services running locally? For example, could I create a .net DLL that permitted interaction with the clipboard at the native OS level? No. You cannot access DLLs. Hank
[flexcoders] Re: Using DateField as itemEditor for DataGrid column
Flex 3 Beta 2 and Flex 2.0.1 HotFix2 (which are the only versions you should be using) Why is that? We're still using HF1 at work because we've not had time to do regression testing on all of our WebService operations. I suppose its a good thing too, considering all the changes in Flex 3 would require us to test yet again. Ben --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: What version of Flex are you using? Flex 3 Beta 2 and Flex 2.0.1 HotFix2 (which are the only versions you should be using) both throw exceptions with this example. DateField isn't really set up to handle XML when it is an item renderer. I sort of got it working like this: mx:DataGridColumn headerText=Date dataField=date width=100 editable=true editorDataField=selectedDate rendererIsEditor=true mx:itemRenderer mx:Component mx:DateField mx:Script ![CDATA[ import mx.controls.listClasses.BaseListData; import mx.controls.dataGridClasses.DataGridListData; // block the underlying DateFields listData so it // doesn't think it is in a DataGrid private var _ld:BaseListData; override public function get listData():BaseListData { return _ld; } override public function set listData(value:BaseListData):void { _ld = value; } private var _dd:Object; override public function get data():Object { return _dd; } override public function set data(value:Object):void { _dd = value; if (_ld _ld is DataGridListData) { var s:String = value[DataGridListData(_ld).dataField].toString(); trace(s); super.data = new Date(Date.parse(s)); } } ]] /mx:Script /mx:DateField /mx:Component /mx:itemRenderer /mx:DataGridColumn Note that the first date in your example is not a valid format for Date.parse(). HTH, -Alex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of carl_steinhilber Sent: Tuesday, December 04, 2007 9:42 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Using DateField as itemEditor for DataGrid column Hi Alex, Sure. (Holiday-themed) example below. :-) XML inline, of course, rather than loaded from external doc as in my final app. As is, it works (all data is shown, and clicking in the date field opens the DateField editor... there's a coercion error on click in debug, but it's silent when not in debug). Changing the date DataGridColumn to mx:DataGridColumn headerText=Date dataField=date width=100 editable=true itemRenderer=mx.controls.DateField editorDataField=selectedDate rendererIsEditor=true / prevents any data from being shown. In debug, the coercion error occurs immediately on creation... which makes perfect sense. So the issue is definitely that Flex can't parse the date from the XML node. But I'm at a loss as to how to define the date in the XML to fix the problem. Am I going to have to step through the XML and convert it to an Object, converting the date along the way? Or is there a more straight-forward solution I'm missing? Would there be a way to wrap the DateField in a custom renderer that can convert the date on the fly? ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml layout=vertical creationComplete=init() mx:Script ![CDATA[ import
Re: [flexcoders] flex newbie
If you want to access the Application object from your ActionScript file, you can use Application.application. If you want to access public memebers of your main MXML Application, cast Application.application to your defined Application class and then access those public memebers. Hope this helps. --- Enrico Hofmann [EMAIL PROTECTED] wrote: hi i am new to flex, i include an run.as in my mx:script tag so like mx:Script source=run.as how can i set the application that it runs after the application is loaded? i allready include in the Windowed Applcation part an applicationComplete(callmyFunction()) but i get for all components that this is an null object whats going wrong using flex3 beta and this is an air application regards enrico hofmann Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
[flexcoders] Re: Loading Web Service from WebSphere
It seems that Flex is getting indeed in an infinite loop. If I enable tracing, you could see it is re-requesting the same XSDs with a different dynamic URL over and over again: http://localhost:9080/CustomerModuleWeb/sca/CustomerDataServiceExport/ws\ dl/process/../xsd-includes/../bo/Customer.xsd http://localhost:9080/CustomerModuleWeb/sca/CustomerDataServiceExport/ws\ dl/process/../xsd-includes/../bo/../bo/Customer.xsd http://localhost:9080/CustomerModuleWeb/sca/CustomerDataServiceExport/ws\ dl/process/../xsd-includes/../bo/../bo/../bo/Customer.xsd http://localhost:9080/CustomerModuleWeb/sca/CustomerDataServiceExport/ws\ dl/process/../xsd-includes/../bo/../bo/../bo/../bo/Customer.xsd http://localhost:9080/CustomerModuleWeb/sca/CustomerDataServiceExport/ws\ dl/process/../xsd-includes/../bo/../bo/../bo/../bo/../bo/Customer.xsd http://localhost:9080/CustomerModuleWeb/sca/CustomerDataServiceExport/ws\ dl/process/../xsd-includes/../bo/../bo/../bo/../bo/../bo/../bo/Customer.\ xsd http://localhost:9080/CustomerModuleWeb/sca/CustomerDataServiceExport/ws\ dl/process/../xsd-includes/../bo/../bo/../bo/../bo/../bo/../bo/../bo/Cus\ tomer.xsd http://localhost:9080/CustomerModuleWeb/sca/CustomerDataServiceExport/ws\ dl/process/../xsd-includes/../bo/../bo/../bo/../bo/../bo/../bo/../bo/../\ bo/Customer.xsd It thinks you get the idea :) It seems that Flex is still buggy on the WebServices side. Any thoughts on this one?? --- In flexcoders@yahoogroups.com, dafox_82 [EMAIL PROTECTED] wrote: When I try to use the WSDL import wizard, I could see my operations resolved correctly, but when clicking Finish, I get the following error: The WSDL definition could not be parsed. The wizard cannot complete successfully. --- In flexcoders@yahoogroups.com, Randy Martin randy@ wrote: My suggestion is that you use FB3 beta 2 and use the WSDL wizard to generate the classes necessary to use the webservice. I did this for two of our webservices, and I had to do only minor tweaks of the generated code to get it to work flawlessly. Pick from the menu in FB or Eclipse, Data | Import Web Service (WSDL) ..., then be sure you pick the SOAP 1.1 port in the wizard. The wizard does not support SOAP 1.2 yet. ~randy _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dafox_82 Sent: Saturday, December 08, 2007 9:46 AM To: flexcoders@yahoogroups.com Subject: [SPAM] [flexcoders] Re: Loading Web Service from WebSphere Nobody with some helpful tips? --- In HYPERLINK mailto:flexcoders%40yahoogroups.comflexcoders@, dafox_82 dafox_82@ wrote: I'm playing around with Flex and want to call a custom made Web Service in WebSphere. When I run my application, It seems that a lot of requests are done to the Web Service repeatably requesting the same XSD's (complex types). It looks like the application is in an infinite loop, constantly doing the same requests.. No call the the web service is made yet at this point. If I call the requested XSD manually in my browser, it is resolved without problems. And if I call another very simple web service, everything is working as expected. My Web Service definition looks like this: mx:WebService id=CALS wsdl=HYPERLINK http://localhost:9080/CustomerModuleWeb/sca/CustomerDataServiceExphttp\ ://l ocalhost:-9080/CustomerMod-uleWeb/sca/-CustomerDataServ-iceExp\ ort/wsdl/CustomerDa-taServiceExport_-CustomerDataServ-iceHttp_Service.-w\ sdl HYPERLINK http://localhost:9080/CustomerModuleWeb/sca/CustomerDataServiceExport/w\ htt p://localhost:-9080/CustomerMod-uleWeb/sca/-CustomerDataServ-iceExport/-\ w\ sdl/CustomerDataSer-viceExport_-CustomerDataServ-iceHttp_Service.-wsdl endpointURI=-HYPERLINK http://localhost:9080/CustomerModuleWeb/sca/CustomerDataSerhttp://loca\ lhos t:-9080/CustomerMod-uleWeb/sca/-CustomerDataSer\ viceExport HYPERLINK http://localhost:9080/CustomerModuleWeb/sca/CustomerDataServiceExporth\ ttp: //localhost:-9080/CustomerMod-uleWeb/sca/-CustomerDataServ-iceExport service=CustomerDa-taServiceExport_-CustomerDataServ-iceHttpService port=CustomerDataS-erviceExport_-CustomerDataServ-iceHttpPort useProxy=false showBusyCursor=-true fault=Alert.-show(event.-fault.faultStrin-g), 'Error' mx:operation name=findAll- mx:request customerRequest Customer CustNo16/-CustNo Group/Group /Customer /customerRequest /mx:request /mx:operation /mx:WebService I'm using Flex Builder 3, Beta (also tried Flex Builder 2, hotfix3) What is going wrong here??? No virus found in this outgoing message. Checked by AVG. Version: 7.5.503 / Virus Database: 269.16.17/1177 - Release Date: 12/7/2007 1:11 PM
RE: [flexcoders] Re: programatically deselect cells in an AdvancedDataGrid (bump)
Does it work for regular DataGrid? If not, post your code. If it only fails for ADG, please file a bug and post the bug number From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of superabe superabe Sent: Sunday, December 09, 2007 3:01 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: programatically deselect cells in an AdvancedDataGrid (bump) Thats what I had hoped would happen too, unfortunately thats not the case with the ADG. Setting selectedIndices to an empty array seems to have no effect on the ADG. It looks like a bug at this point. -superabe On Dec 8, 2007 4:49 PM, David Spurr [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: In the standard datagrid (so I assume it's not different for the AdvancedDataGrid as I haven't played with it yet,) you just need to set the selected indices to an empty array. To all select all and select none as a global feature in our app I simply made a DataGridUtil class with static methods of selectAll( dataGrid:DataGrid ) selectNone( dataGrid:DataGrid )
RE: [flexcoders] Re: Using DateField as itemEditor for DataGrid column
Simply because each release theoretically got better w/o degradation in other places. I know that's not totally true so a few of you are relying on older releases, but I often find myself looking at these examples on to realize they got fixed already. It would also depend on how close I am to shipping. If I'm just about ready to publish, I probably wouldn't upgrade either, but otherwise, if I saw what appeared to be an obvious problem, I would certainly at least try it on a 'latest' release. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: Sunday, December 09, 2007 5:19 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Using DateField as itemEditor for DataGrid column Flex 3 Beta 2 and Flex 2.0.1 HotFix2 (which are the only versions you should be using) Why is that? We're still using HF1 at work because we've not had time to do regression testing on all of our WebService operations. I suppose its a good thing too, considering all the changes in Flex 3 would require us to test yet again. Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui [EMAIL PROTECTED] wrote: What version of Flex are you using? Flex 3 Beta 2 and Flex 2.0.1 HotFix2 (which are the only versions you should be using) both throw exceptions with this example. DateField isn't really set up to handle XML when it is an item renderer. I sort of got it working like this: mx:DataGridColumn headerText=Date dataField=date width=100 editable=true editorDataField=selectedDate rendererIsEditor=true mx:itemRenderer mx:Component mx:DateField mx:Script ![CDATA[ import mx.controls.listClasses.BaseListData; import mx.controls.dataGridClasses.DataGridListData; // block the underlying DateFields listData so it // doesn't think it is in a DataGrid private var _ld:BaseListData; override public function get listData():BaseListData { return _ld; } override public function set listData(value:BaseListData):void { _ld = value; } private var _dd:Object; override public function get data():Object { return _dd; } override public function set data(value:Object):void { _dd = value; if (_ld _ld is DataGridListData) { var s:String = value[DataGridListData(_ld).dataField].toString(); trace(s); super.data = new Date(Date.parse(s)); } } ]] /mx:Script /mx:DateField /mx:Component /mx:itemRenderer /mx:DataGridColumn Note that the first date in your example is not a valid format for Date.parse(). HTH, -Alex From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of carl_steinhilber Sent: Tuesday, December 04, 2007 9:42 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Using DateField as itemEditor for DataGrid column Hi Alex, Sure. (Holiday-themed) example below. :-) XML inline, of course, rather than loaded from external doc as in my final app. As is, it works (all data is shown, and clicking in the date field opens the DateField editor... there's a coercion error on click in debug, but it's silent when not in debug). Changing the date DataGridColumn to mx:DataGridColumn headerText=Date dataField=date width=100 editable=true itemRenderer=mx.controls.DateField editorDataField=selectedDate rendererIsEditor=true / prevents any data from being shown. In debug, the coercion error occurs immediately on creation... which makes perfect sense. So the issue is definitely that Flex can't parse the date from the XML node. But I'm at a loss as to how to define the date in the XML to fix the problem. Am I going to have to step through the XML and convert it to an Object, converting the date along the way? Or is there a more straight-forward solution I'm missing? Would there be a way to wrap the DateField in a custom renderer that can convert the date on the fly? ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml layout=vertical creationComplete=init() mx:Script ![CDATA[ import mx.collections.XMLListCollection; [Bindable] private var xmlChristmas:XMLListCollection; private function init():void { xmlChristmas = new XMLListCollection(xmlDaysOfChristmas.day.copy()); } private var xmlDaysOfChristmas:XML = root day nameFirst Day of Christmas/name date2007-12-25T00:00:00.000-05:00/date giftPartridge in a pear tree/gift /day day nameSecond Day of Christmas/name date12/26/2007/date giftTwo turtle doves/gift /day day nameThird Day of Christmas/name dateThu Dec 27 00:00:00
[flexcoders] AS3 classes as MXML to enclose other tags
I've been looking Cairngorm and I saw this:- ?xml version=1.0 encoding=utf-8? cairngorm:ServiceLocator xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:cairngorm=com.adobe.cairngorm.business.* mx:RemoteObject id=addcontactService destination=addcontactService showBusyCursor=true result=event.token.resultHandler( event ); fault=event.token.faultHandler( event ); /mx:RemoteObject /cairngorm:ServiceLocator where ServiceLocator is a user defined class. What is this mechanism called and where can I learn how it works? Chris -- Chris Velevitch Manager - Sydney Flash Platform Developers Group m: 0415 469 095 www.flashdev.org.au
Re: [flexcoders] AS3 classes as MXML to enclose other tags
cairngorm:ServiceLocator xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:cairngorm=com.adobe.cairngorm.business.* That would be the same as: public class Services extends com.adobe.cairngorm.business.ServiceLocator {} Where Services is the name of the mxml file that has cairngorm:ServiceLocator... defined as its base tag. Add the -keep argument to the compiler options to see what goes on behind the scenes. regards, Muzak - Original Message - From: Chris Velevitch [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Monday, December 10, 2007 12:27 AM Subject: [flexcoders] AS3 classes as MXML to enclose other tags I've been looking Cairngorm and I saw this:- ?xml version=1.0 encoding=utf-8? cairngorm:ServiceLocator xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:cairngorm=com.adobe.cairngorm.business.* mx:RemoteObject id=addcontactService destination=addcontactService showBusyCursor=true result=event.token.resultHandler( event ); fault=event.token.faultHandler( event ); /mx:RemoteObject /cairngorm:ServiceLocator where ServiceLocator is a user defined class. What is this mechanism called and where can I learn how it works? Chris -- Chris Velevitch Manager - Sydney Flash Platform Developers Group m: 0415 469 095 www.flashdev.org.au -- 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] AS3 classes as MXML to enclose other tags
com.adobe.cairngorm.business.ServiceLocator You've defined the cairngorm namespace in the base tag. On 10/12/2007, at 10:27 AM, Chris Velevitch wrote: I've been looking Cairngorm and I saw this:- ?xml version=1.0 encoding=utf-8? cairngorm:ServiceLocator xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:cairngorm=com.adobe.cairngorm.business.* mx:RemoteObject id=addcontactService destination=addcontactService showBusyCursor=true result=event.token.resultHandler( event ); fault=event.token.faultHandler( event ); /mx:RemoteObject /cairngorm:ServiceLocator where ServiceLocator is a user defined class. What is this mechanism called and where can I learn how it works? Chris -- Chris Velevitch Manager - Sydney Flash Platform Developers Group m: 0415 469 095 www.flashdev.org.au
Re: [flexcoders] AS3 classes as MXML to enclose other tags
same as mx:Button xmlns:mx=http://www.adobe.com/2006/mxml*; On 10/12/2007, at 10:52 AM, Muzak wrote: cairngorm:ServiceLocator xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:cairngorm=com.adobe.cairngorm.business.* That would be the same as: public class Services extends com.adobe.cairngorm.business.ServiceLocator {} Where Services is the name of the mxml file that has cairngorm:ServiceLocator... defined as its base tag. Add the -keep argument to the compiler options to see what goes on behind the scenes. regards, Muzak - Original Message - From: Chris Velevitch [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Monday, December 10, 2007 12:27 AM Subject: [flexcoders] AS3 classes as MXML to enclose other tags I've been looking Cairngorm and I saw this:- ?xml version=1.0 encoding=utf-8? cairngorm:ServiceLocator xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:cairngorm=com.adobe.cairngorm.business.* mx:RemoteObject id=addcontactService destination=addcontactService showBusyCursor=true result=event.token.resultHandler( event ); fault=event.token.faultHandler( event ); /mx:RemoteObject /cairngorm:ServiceLocator where ServiceLocator is a user defined class. What is this mechanism called and where can I learn how it works? Chris -- Chris Velevitch Manager - Sydney Flash Platform Developers Group m: 0415 469 095 www.flashdev.org.au -- 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
Re: [flexcoders] AS3 classes as MXML to enclose other tags
Sorry, but I obviously my question isn't clear. My question is about the Flex language and the mechanism in Flex that allows me to take any class and use it as a tag to wrap around one or more other tags. I want to know what this mechanism in the Flex language is called and where I can learn more about how it? This question is not about Cairngorm. Cairngorm is first place I've seen this mechanism of Flex being used and I want to learn more about this Flex Language mechanism. Chris -- Chris Velevitch Manager - Sydney Flash Platform Developers Group m: 0415 469 095 www.flashdev.org.au
[flexcoders] Lists and mouseover
Hi Guys, Is it possible to easily get the data of the mouseover target within a list the way one can just select list.selectedItem ? Cheers, -Josh -- This is crazy! Why are we talking about going to bed with Wilma Flintstone... She'll never leave Fred and we know it. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
[flexcoders] RangeError: Error #2006: The supplied index is out of ... With dynamic Repeater
My application creates new tabnavigator tabs using a Repeater driven by a dynamically updated arrayCollection. I hope there's a simple fix to this runtime error that's been dogging me for several days. I'm using this arrayCollection as the data provider: mx:ArrayCollection id=repeaterAC mx:Array id=myRepeaterArray mx:Object label=0 data=0/ /mx:Array /mx:ArrayCollection -- Here's the repeater MXML snippet: mx:Canvas label=Personal Info width=100% height=100% mx:TabNavigator id=tabnavPersonalInfo x=0 y=0 width=100% height=100% mx:Repeater id=rptApplicant dataProvider={repeaterAC} recycleChildren=true mx:Canvas label=New {rptApplicant.currentIndex} width=100% height=100% id=personalTab horizontalScrollPolicy=off verticalScrollPolicy=off creationComplete=bringApplicantDataForward() !-- form elements omitted -- /mx:Canvas /mx:Repeater -- This function is the click event for a button. It adds an item to the arrayCollection triggering the 'repeat' and it sets the focus to the newly created tab: private function tabnavPersonalInfo_addTab():void { var myInt:int = myRepeaterArray.length; var myVar:String = myInt.toString(); repeaterAC.addItemAt({label:myVar, data:myVar}, myInt); tabnavPersonalInfo.selectedIndex=myRepeaterArray.length; } -- This is the run time error thrown by Flash Player 9 when the 'button' is clicked to run the above function: RangeError: Error #2006: The supplied index is out of bounds. at flash.display::DisplayObjectContainer/setChildIndex() at mx.core::Container/setChildIndex() at mx.core::Repeater/::recycle() at mx.core::Repeater/::execute() at mx.core::Repeater/::collectionChangedHandler() at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.collections::ListCollectionView/dispatchEvent() at mx.collections::ListCollectionView/::addItemsToView() at mx.collections::ListCollectionView/::listChangeHandler() at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.collections::ArrayList/::internalDispatchEvent() at mx.collections::ArrayList/addItemAt() at mx.collections::ListCollectionView/addItemAt() at Components.flexadmin::flexmod/::tabnavPersonalInfo_addChild() at Components.flexadmin::flexmod/___Button7_click() -- When I click Continue in the error window, all is well (the newly 'repeated' tab is created with all it's visual elements and focus is set to it). I have tried using a try{} catch(error:*){} structure, but it did not 'catch' this error. I've also tried changing the array index to different values, but what you see in this code works. FWIW, nowhere in my code do I ever removeChild()... only add via the Repeater. How do I avoid the error or how can I suppress the modal runtime error window? Any ideas would certainly be appreciated! TIA, Rob Oates Boise, Idaho, USA
Re: [flexcoders] AS3 classes as MXML to enclose other tags
On 10/12/2007, at 10:52 AM, Muzak wrote: Add the -keep argument to the compiler options to see what goes on behind the scenes. This will give you your answer.
Re: [flexcoders] AS3 classes as MXML to enclose other tags
On Dec 10, 2007 12:07 PM, Bjorn Schultheiss [EMAIL PROTECTED] wrote: Add the -keep argument to the compiler options to see what goes on behind the scenes. This will give you your answer. I'm looking for something at a higher level before I go for a deep dive into the inner workings of the Flex compiler. Besides, the compiler output won't explain the concepts and philosophy behind it. Chris -- Chris Velevitch Manager - Sydney Flash Platform Developers Group m: 0415 469 095 www.flashdev.org.au
Re: [flexcoders] AS3 classes as MXML to enclose other tags
Man, what concepts and philosophies are you looking for? It's pretty simple. Your just specifying an existing Class you wish to extend. On 10/12/2007, at 1:37 PM, Chris Velevitch wrote: On Dec 10, 2007 12:07 PM, Bjorn Schultheiss [EMAIL PROTECTED] wrote: Add the -keep argument to the compiler options to see what goes on behind the scenes. This will give you your answer. I'm looking for something at a higher level before I go for a deep dive into the inner workings of the Flex compiler. Besides, the compiler output won't explain the concepts and philosophy behind it. Chris -- Chris Velevitch Manager - Sydney Flash Platform Developers Group m: 0415 469 095 www.flashdev.org.au
[flexcoders] Re: Sizing and layout of UI components with respect to parent containers
Yarin, I am struggling with the same issue you report here: Essentially when I give a Container inheritor percentHeight=100, the Container will resize itself to fit its children when they become larger than the Container's parent. This really sucks. Is it true that nobody ever replied to your message? If so, I would suggest that we spend a little bit of time looking at the Framework source code so we can figure out if there's any way around this. Because right now I am hardcoded pixel values for some VBoxes in my app to work around this. Adam --- In flexcoders@yahoogroups.com, y_kessler [EMAIL PROTECTED] wrote: Here is a layout issue I've been struggling with for many weeks now: Essentially, I am looking for a way to size a container component as a percentage relative to the space available to it in its parent, and with no consideration of the size of its children. As an example, here's the mxml for an hbox that hosts a vbox that hosts a number of dummy components (Taken from an AIR example)... mx:WindowedApplication width=400 height=300 mx:HBox id=hboxMain x=0 y=0 width=100% height=100% autoLayout=true mx:VBox id=vboxMain width=200 height=100% autoLayout=true ns1:DummyComponent width=75 height=75/ ns1:DummyComponent width=75 height=75/ ns1:DummyComponent width=75 height=75/ /mx:VBox /mx:HBox /mx:WindowedApplication I've been coding in Flex for some time now, but frankly I'm still confused over the concept of percent sizing. If I assign vboxMain height = 100%, it will stretch to fit the available height in its parent container, unless the height of its children exceed that value, in which case it will stretch beyond the space alloted to it. I am looking for the following solutions: a) Can I somehow tell vboxMain to only size according to the space available to it in hboxMain (not exceed hboxMain's visible space), and to scroll or clip the content of its children? b) Is there any way to establish the visible dimensions of a given UI component, as opposed to its unscaled/measured/regular dimensions. That is, if the vbox is stretched to beyond the space available to it, I should at least be able to establish how much of it is visible on the screen. Some final notes: I've noticed that scrolling/sizing behavior is often different depending on whether the dummy controls in this particular example are added dynamically or directly in mxml, and whether auto layout = true is set dynamically. From what I understand the auto-layout process works from the inside out. It's almost as if I'm seeking to reverse this process, so that the size of a component's parent drives the layout process instead of its children. I would much appreciate any help you could give me on this topic. This has been a major stumbling point for me- Thanks! Yarin
RE: [flexcoders] Re: Sizing and layout of UI components with respect to parent containers
See what happens when you set minWidth and minHeight=0 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of aduston1976 Sent: Sunday, December 09, 2007 7:08 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Sizing and layout of UI components with respect to parent containers Yarin, I am struggling with the same issue you report here: Essentially when I give a Container inheritor percentHeight=100, the Container will resize itself to fit its children when they become larger than the Container's parent. This really sucks. Is it true that nobody ever replied to your message? If so, I would suggest that we spend a little bit of time looking at the Framework source code so we can figure out if there's any way around this. Because right now I am hardcoded pixel values for some VBoxes in my app to work around this. Adam --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , y_kessler [EMAIL PROTECTED] wrote: Here is a layout issue I've been struggling with for many weeks now: Essentially, I am looking for a way to size a container component as a percentage relative to the space available to it in its parent, and with no consideration of the size of its children. As an example, here's the mxml for an hbox that hosts a vbox that hosts a number of dummy components (Taken from an AIR example)... mx:WindowedApplication width=400 height=300 mx:HBox id=hboxMain x=0 y=0 width=100% height=100% autoLayout=true mx:VBox id=vboxMain width=200 height=100% autoLayout=true ns1:DummyComponent width=75 height=75/ ns1:DummyComponent width=75 height=75/ ns1:DummyComponent width=75 height=75/ /mx:VBox /mx:HBox /mx:WindowedApplication I've been coding in Flex for some time now, but frankly I'm still confused over the concept of percent sizing. If I assign vboxMain height = 100%, it will stretch to fit the available height in its parent container, unless the height of its children exceed that value, in which case it will stretch beyond the space alloted to it. I am looking for the following solutions: a) Can I somehow tell vboxMain to only size according to the space available to it in hboxMain (not exceed hboxMain's visible space), and to scroll or clip the content of its children? b) Is there any way to establish the visible dimensions of a given UI component, as opposed to its unscaled/measured/regular dimensions. That is, if the vbox is stretched to beyond the space available to it, I should at least be able to establish how much of it is visible on the screen. Some final notes: I've noticed that scrolling/sizing behavior is often different depending on whether the dummy controls in this particular example are added dynamically or directly in mxml, and whether auto layout = true is set dynamically. From what I understand the auto-layout process works from the inside out. It's almost as if I'm seeking to reverse this process, so that the size of a component's parent drives the layout process instead of its children. I would much appreciate any help you could give me on this topic. This has been a major stumbling point for me- Thanks! Yarin
RE: [flexcoders] Lists and mouseover
itemRollOver should have the renderer which should have the data From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Sunday, December 09, 2007 4:35 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Lists and mouseover Hi Guys, Is it possible to easily get the data of the mouseover target within a list the way one can just select list.selectedItem ? Cheers, -Josh -- This is crazy! Why are we talking about going to bed with Wilma Flintstone... She'll never leave Fred and we know it. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Re: [flexcoders] AS3 classes as MXML to enclose other tags
Of course. It's declaratively extending a class and everything declaration enclosed is an instance of some (other) class. I totally forgot that you can also extend classes in mxml. Thanks Shaun. That's the answer I was look for. On Dec 10, 2007 2:10 PM, shaun [EMAIL PROTECTED] wrote: Chris Velevitch wrote: On Dec 10, 2007 12:07 PM, Bjorn Schultheiss [EMAIL PROTECTED] wrote: Add the -keep argument to the compiler options to see what goes on behind the scenes. This will give you your answer. I'm looking for something at a higher level before I go for a deep dive into the inner workings of the Flex compiler. Besides, the compiler output won't explain the concepts and philosophy behind it. Chris I think(without looking at the generated code) its basically composition. As you are aware you have extended an existing class(ServiceLocator). The wrapped tag (a RemoteObject) is an instance variable contained in your ServiceLocator subclass. I don't think there is much more to it than that but i'm pretty much guessing as I havent actually looked at the generated code. ?xml version=1.0 encoding=utf-8? cairngorm:ServiceLocator xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:cairngorm=com.adobe.cairngorm.business.* mx:RemoteObject id=addcontactService destination=addcontactService showBusyCursor=true result=event.token.resultHandler( event ); fault=event.token.faultHandler( event ); /mx:RemoteObject /cairngorm:ServiceLocator Your component is extending ServiceLocator and I image it will have a reference to a RemoteObject and the reference is called addcontactService. If it was as3 it might look something like: class Foo extends cairngorm.ServiceLocator{ protected var addcontactService:RemoteObject; //etc. etc. } I suppose I should actually check this for myself. :) HTH. - shaun -- Chris Velevitch Manager - Sydney Flash Platform Developers Group m: 0415 469 095 www.flashdev.org.au
[flexcoders] Re: AS3 classes as MXML to enclose other tags
This really isn't rocket science. Suppose you have an AS3 class defined like this: package controls { import mx.controls.Alert; public class MyAlerts extends Alert { [Embed(source=../images/error.gif)] private static var iconError:Class; public static function error(msg:String, closeHandler:Function=null):void { show(msg, Error, Alert.OK, null, closeHandler, iconError); } } } This defines a new Alert class called MyAlerts. You name the file MyAlerts.as and put it in the controls directory. Now you can do this: ?xml version=1.0 encoding=utf-8? mycontrols:MyAlerts xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml xmlns:mycontrols=controls.* mx:Script ![CDATA[ import controls.MyAlerts; public static function showMsg(msg:String):void { MyAlerts.error(msg); } ]] /mx:Script /mycontrols:MyAlerts Save this bit of code in MyErrorMsg.mxml. As far as Flex is concerned MyErrorMsg is another class that extends your MyAlerts class, so you can now do this: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml xmlns:myerror=controls.* layout=absolute mx:Script ![CDATA[ import controls.MyErrorMsg; private function showErrorMessage():void { MyErrorMsg.showMsg(This is bad! Very bad!!); } ]] /mx:Script mx:VBox height=300 width=400 borderStyle=solid cornerRadius=5 horizontalAlign=center verticalAlign=middle backgroundColor=#ff mx:Button horizontalCenter=0 verticalCenter=0 label=Show Error click=showErrorMessage()/ /mx:VBox /mx:Application Get it now? Flex treats all .mxml files and .as files as separate classes, so when the base tag in an mxml file is your custom class, the mxml file is just creating another class by extending your custom class. You could have done this in actionscript instead of mxml for the MyErrorMsg class: package controls { import controls.MyAlerts; public function MyErrorMsg extends MyAlerts { public static function showMsg(msg:String):void { MyAlerts.error(msg); } } } In either case, the application mxml file would have been the same. HTH, Randy --- In flexcoders@yahoogroups.com, Chris Velevitch [EMAIL PROTECTED] wrote: On Dec 10, 2007 12:07 PM, Bjorn Schultheiss [EMAIL PROTECTED] wrote: Add the -keep argument to the compiler options to see what goes on behind the scenes. This will give you your answer. I'm looking for something at a higher level before I go for a deep dive into the inner workings of the Flex compiler. Besides, the compiler output won't explain the concepts and philosophy behind it. Chris -- Chris Velevitch Manager - Sydney Flash Platform Developers Group m: 0415 469 095 www.flashdev.org.au
RE: [flexcoders] Height Problems of List component using itemrenderer with different row height
Looks like I need to add another chapter to my blog about item renderers. Several folks have struggled with wordwrapping text in renderers. I strongly recommend taking the code from ListItemRenderer and working from there because: 1) It is in AS and so will be lighterweight than this nest of containers 2) it makes it easier to control scrollbars 3) It makes it easier to handle explicitWidth The lifecycle for renderers is different than for components in an MXML file. The renderer is instantiated and added to the display list (or recycledfrom the free list), assigned a .data item, given an explicitWidth and measured to determine its height. % width/height is ignored in the top-level containers and the measure method needs to respect the explicitWIdth property. It is much more top-down than for regular components which are measured from the bottom up. I hacked some values and binding into your example to get it to work. To generalize, you'd have to call getStyle() on horizontalGap and factor in the button's size. To me, it is always much cleaner just to write the AS code instead of having all of these containers. ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:view=* verticalScrollPolicy=off horizontalScrollPolicy=off mx:VBox id=testVBox width={explicitWidth} height=100% horizontalScrollPolicy=off mx:HBox width={explicitWidth} id=testHbox mx:VBox id=nameBox width={explicitWidth - 24} mx:Text id=testText text={data.label} selectable=false width={nameBox.explicitWidth}/ mx:Label id=testLabel text={data.data} truncateToFit=true selectable=false / /mx:VBox mx:Button id=testButton width=16 height=16 buttonMode=true/ /mx:HBox /mx:VBox /mx:Canvas However, in poking at this, your example did expose a bug that we'll try to squeeze into Flex 3 before it ships. The measureHeightOfItems does not factor in paddingLeft/Right. I had to set it to zero in the main app otherwise scrollbars popped up. HTH, -Alex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Christoph Atteneder Sent: Friday, November 30, 2007 9:00 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Height Problems of List component using itemrenderer with different row height With the default renderer with wordWrap = true and variableRowHeight= true it works if I´m setting the height of the list after calling measureHeightOfItems(). But it is not working if you are using more sophisticated ItemRenderers( e.g. with VBox and multiple TextFields, Buttons,...) I´ve already uploaded a simple Example under www.cubeworx.net/ripcurlx/ResizeBug.zip http://www.cubeworx.net/ripcurlx/ResizeBug.zip br, Christoph On Nov 30, 2007 5:47 PM, Alex Harui [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: does it work with the default renderers with wordWrap=true and variableRowHeight=true? From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ] On Behalf Of Christoph Atteneder Sent: Friday, November 30, 2007 7:43 AM To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com Subject: [flexcoders] Height Problems of List component using itemrenderer with different row height Hi, My problem is following: I have a List component which is filled with a list of properties and I want to know how much space it needs to display all of its items. This only works with single label renderer or renderer with a fixed height, but not with renderer with different row height with Text component. I really have big problems with all releases of the flex 3 framework so far regarding this issue. I´ve uploaded a flex builder project for testing. www.cubeworx.net/ripcurlx/ResizeBug.zip http://www.cubeworx.net/ripcurlx/ResizeBug.zip This text wrap size problem is critical for my application, so I hope there is at least a workaround for this issue. thx for any hints in advance br, Christoph
[flexcoders] unable to hide datagrid column...help please
Here is my mxml: mx:DataGrid id=dg x=0 y=0 width=100% height=100% dataProvider={xmlData} doubleClickEnabled=true itemDoubleClick={updateCompanyData(event)} headerRelease={headerReleaseFunc(event)} mx:columns mx:DataGridColumn headerText=Company dataField=@name/ mx:DataGridColumn headerText=Total Active Users dataField=@totalUsers sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Unique Callers dataField=@uniqueCallers sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Total Calls Attemped dataField=@totalCalls sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Total Successful Calls dataField=@successCalls sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Company ID id=companyid dataField=@id visible=false/ /mx:columns /mx:DataGrid I want to hide the company id column, however it still displays. Ideas?
RE: [flexcoders] DataGrid tab order (again)
Yeah, that's SDK-12588. Fixed in Flex 3. It appears you can sort of get around it like this: import mx.controls.listClasses.ListBaseContentHolder; private function hackit():void { var n:int = srcgrid5.numChildren; for (var i:int = 0; i n; i++) { if (srcgrid5.getChildAt(i) is ListBaseContentHolder) { ListBaseContentHolder(srcgrid5.getChildAt(i)).tabChildren = true; break; } } } ]] /mx:Script mx:TextInput x=19 y=10 text=Start here!/ mx:DataGrid id=srcgrid5 dataProvider={sampleData} editable=true x=19 y=40 tabChildren=true initialize=hackit() From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Stephen Roy J. Tang Sent: Wednesday, December 05, 2007 5:00 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] DataGrid tab order (again) Hi! Thanks to Alex's help I got the datagrid tab order functionality I needed mostly working (including avoiding the datagrid remembering the last edited cell). Just one minor issue now, which I *might* be able to just ignore, but I'm curious about it because it works correctly on Firefox, but not on IE. Specifically, when I reverse-tab (shift+tab) out of my DataGrid, the focus seems to be going to the wrong control. But it only happens in IE. Check my sample here: http://roytang.net/sandbox/DataGridTabOrder.swf http://roytang.net/sandbox/DataGridTabOrder.swf Source: http://roytang.net/sandbox/DataGridTabOrder.mxml http://roytang.net/sandbox/DataGridTabOrder.mxml Is it a bug in the SDK? or is there something I can do to work around it? Thanks! Roy
RE: [flexcoders] Menubar Render
Try setting mouseEnabled and/or mouseChildren=false on the label and other children. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Marvin Froeder Sent: Wednesday, December 05, 2007 10:55 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Menubar Render Hi folks, I had create a MenuBar (copy from LiveDoc's exemple) and set a custom menuBarItemRenderer. But when I tried to run I got a runtime error, every time I put the cursor over the render. Error: TypeError: Error #1034: Type Coercion failed: cannot convert mx.core::[EMAIL PROTECTED] to mx.controls.menuClasses.IMenuBarItemRenderer. at mx.controls::MenuBar/mouseOverHandler()[E:\dev\flex_201_borneo\sdk\frame works\mx\controls\MenuBar.as:1670] Menubar (MenuBarLiveDocsExample.mxml): ?xml version=1.0 encoding=utf-8? !-- Simple example to demonstrate the MenuBar control. -- mx:Application xmlns:mx= http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml creationComplete=initCollections(); mx:Script ![CDATA[ import mx.events.MenuEvent; import mx.controls.Alert; import mx.collections.*; [Bindable] public var menuBarCollection:XMLListCollection; private var menubarXML:XMLList = menuitem label=Menu1 data=top menuitem label=MenuItem 1-A data=1A/ menuitem label=MenuItem 1-B data=1B/ /menuitem menuitem label=Menu2 data=top menuitem label=MenuItem 2-A type=check data=2A/ menuitem type=separator/ menuitem label=MenuItem 2-B menuitem label=SubMenuItem 3-A type=radio groupName=one data=3A/ menuitem label=SubMenuItem 3-B type=radio groupName=one data=3B/ /menuitem /menuitem /; // Event handler to initialize the MenuBar control. private function initCollections():void { menuBarCollection = new XMLListCollection(menubarXML); } // Event handler for the MenuBar control's itemClick event. private function menuHandler(event:MenuEvent):void { // Don't open the Alert for a menu bar item that // opens a popup submenu. if ([EMAIL PROTECTED] != top) { Alert.show(Label: + [EMAIL PROTECTED] + \n + Data: + [EMAIL PROTECTED], Clicked menu item); } } ]] /mx:Script mx:Panel title=MenuBar Control Example height=75% width=75% paddingTop=10 paddingLeft=10 mx:Label width=100% color=blue text=Select a menu item./ mx:MenuBar labelField=@label itemClick=menuHandler(event); dataProvider={menuBarCollection} menuBarItemRenderer=MyCustomRender/ /mx:Panel /mx:Application Item Render (MyCustomRender.mxml) : ?xml version=1.0 encoding=utf-8? mx:HBox xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml implements=mx.controls.menuClasses.IMenuBarItemRenderer mx:Script ![CDATA[ import mx.controls.MenuBar; private var _menuBar:MenuBar; private var _menuBarIndex:int; private var _menuBarItemState:String; public function get menuBar():MenuBar { return _menuBar; } public function set menuBar(value:MenuBar):void { _menuBar = value; } public function get menuBarItemIndex():int { return _menuBarIndex; } public function set menuBarItemIndex(value:int):void { _menuBarIndex = value; } public function get menuBarItemState():String { return _menuBarItemState; } public
Re: [flexcoders] unable to hide datagrid column...help please
There is something wrong with datagrid bindind. I have tried the following two examples to hide the datagrid column 1. First Example (Without data binding) mx:DataGrid id=dg editable=true mx:columns mx:DataGridColumn dataField=Artist headerText=Artist editable=false visible=false/ mx:DataGridColumn dataField=Album headerText=Album/ mx:DataGridColumn dataField=Price headerText=Price/ /mx:columns /mx:DataGrid When I ran the above example, first column was not visible. Then I add dataprovider to the above example as shown below. 2. Second Example [Bindable] private var dataArray:Array = [ {Artist:'Carole King', Album:'Tapestry', Price:11.99}, {Artist:'Paul Simon', Album:'Graceland', Price:10.99}, {Artist:'Original Cast', Album:'Camelot', Price:12.99}, {Artist:'The Beatles', Album:'The White Album', Price:11.99} ]; mx:DataGrid id=dg editable=true dataProvider={this.dataArray} mx:columns mx:DataGridColumn dataField=Artist headerText=Artist editable=false visible=false/ mx:DataGridColumn dataField=Album headerText=Album/ mx:DataGridColumn dataField=Price headerText=Price/ /mx:columns /mx:DataGrid Now when I ran the application, the first columns was visible. --- phipzkillah [EMAIL PROTECTED] wrote: Here is my mxml: mx:DataGrid id=dg x=0 y=0 width=100% height=100% dataProvider={xmlData} doubleClickEnabled=true itemDoubleClick={updateCompanyData(event)} headerRelease={headerReleaseFunc(event)} mx:columns mx:DataGridColumn headerText=Company dataField=@name/ mx:DataGridColumn headerText=Total Active Users dataField=@totalUsers sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Unique Callers dataField=@uniqueCallers sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Total Calls Attemped dataField=@totalCalls sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Total Successful Calls dataField=@successCalls sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Company ID id=companyid dataField=@id visible=false/ /mx:columns /mx:DataGrid I want to hide the company id column, however it still displays. Ideas? Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
[flexcoders] Re: unable to hide datagrid column...help please
The column is not visible in my example when the xmllist is not populated. When I bind the xmllist the column becomes visible. Is there a work around? -phil --- In flexcoders@yahoogroups.com, Jehanzeb Musani [EMAIL PROTECTED] wrote: There is something wrong with datagrid bindind. I have tried the following two examples to hide the datagrid column 1. First Example (Without data binding) mx:DataGrid id=dg editable=true mx:columns mx:DataGridColumn dataField=Artist headerText=Artist editable=false visible=false/ mx:DataGridColumn dataField=Album headerText=Album/ mx:DataGridColumn dataField=Price headerText=Price/ /mx:columns /mx:DataGrid When I ran the above example, first column was not visible. Then I add dataprovider to the above example as shown below. 2. Second Example [Bindable] private var dataArray:Array = [ {Artist:'Carole King', Album:'Tapestry', Price:11.99}, {Artist:'Paul Simon', Album:'Graceland', Price:10.99}, {Artist:'Original Cast', Album:'Camelot', Price:12.99}, {Artist:'The Beatles', Album:'The White Album', Price:11.99} ]; mx:DataGrid id=dg editable=true dataProvider={this.dataArray} mx:columns mx:DataGridColumn dataField=Artist headerText=Artist editable=false visible=false/ mx:DataGridColumn dataField=Album headerText=Album/ mx:DataGridColumn dataField=Price headerText=Price/ /mx:columns /mx:DataGrid Now when I ran the application, the first columns was visible. --- phipzkillah [EMAIL PROTECTED] wrote: Here is my mxml: mx:DataGrid id=dg x=0 y=0 width=100% height=100% dataProvider={xmlData} doubleClickEnabled=true itemDoubleClick={updateCompanyData(event)} headerRelease={headerReleaseFunc(event)} mx:columns mx:DataGridColumn headerText=Company dataField=@name/ mx:DataGridColumn headerText=Total Active Users dataField=@totalUsers sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Unique Callers dataField=@uniqueCallers sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Total Calls Attemped dataField=@totalCalls sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Total Successful Calls dataField=@successCalls sortCompareFunction=sortCompareFunc/ mx:DataGridColumn headerText=Company ID id=companyid dataField=@id visible=false/ /mx:columns /mx:DataGrid I want to hide the company id column, however it still displays. Ideas? Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping