[flexcoders] Strange Behavior When Loading Sub Application
Hi, I am experiencing an odd problem and I hope someone knows why. I am loading a sub-application using SWFLoader. I listen for the Event.COMPLETE command. Once the swf is loaded, I then add a listener to the SystemManager for the swf and listen for the FlexEvent.APPLICATION_COMPLETE event. At that point, I add the application as a child to a Canvas that exists in a view stack (see code below). This is great, the content loads, but it doesn't seem to load correctly. The legends in my charts are not oriented the way they should be and whenever I roll over an item with a tooltip, I get errors like the following error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.managers::SystemManager/get toolTipChildren()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:1178] at mx.charts.chartClasses::ChartBase/updateDataTipToMatchHitSet()[C:\work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses\ChartBase.as:3030] Does anyone have any clue what is going on?? Thanks, Jim !! snippet where swf is loaded .. var loader:SWFLoader = null; if (content.contentType == ContentData.SWF) { var uri:String = content.contentUri; var loaderContext:LoaderContext = new LoaderContext(); loaderContext.applicationDomain = ApplicationDomain.currentDomain; loaderContext.securityDomain = SecurityDomain.currentDomain; /* Create the swf loader and add it as a child to a canvas * so that it will have a place to display on the display list */ loader = new SWFLoader(); loader.scaleContent = true; loader.loaderContext = loaderContext; loader.addEventListener(Event.COMPLETE, onLoadingComplete); loader.addEventListener(IOErrorEvent.IO_ERROR, onModuleLoadError); loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onModuleLoadError); loader.load(uri); . private function onLoadingComplete(event:Event):void { var swfLoader:SWFLoader = event.currentTarget as SWFLoader; if (swfLoader != null swfLoader.content != null) { /* Create an annoymous listener that dispatches an event when the module is ready to show */ sm.addEventListener(FlexEvent.APPLICATION_COMPLETE, function(flexEvent:FlexEvent):void { var cmEvent:ContentManagementEvent = new ContentManagementEvent(ContentManagementEvent.CONTENT_READY_TO_SHOW); cmEvent.moduleLoader = swfLoader; // Grab a reference to the module application itself if (flexEvent.currentTarget.application is IModule) { cmEvent.moduleApp = flexEvent.currentTarget.application as IModule; } dispatch(cmEvent); }); } } } !! snippet when adding to Canvas if (event.moduleApp != null) { Logger.debug(Setting parentInjector and starting the RL context for : + moduleId); // Make sure the content fills the page var subAppComponent:SubAppBase = SubAppBase(subApp); subAppComponent.percentHeight = 100; subAppComponent.percentWidth = 100; /* Add to contentViewStack here based upon position Simply add as a child to the stub canvas that already exists for the module */
[flexcoders] Strange behavior with array filter function
Can anyone tell me what I am doing wrong with this filter function. I am passing in an array of valueObjects into the following filter function public static function filterCallSchedule(o:*, index:int, arr:Array):Boolean { var modelLocator:AppModelLocator = AppModelLocator.getInstance(); trace('ooo - ' + o.callDate); trace('mmm - ' + modelLocator.currentlySelectedCallDate); trace(ObjectUtil.toString(o)); if (o.callDate == modelLocator.currentlySelectedCallDate) { trace(true); return true; } else { trace(false); return false; } } This is some of the data returned as I trace this functions execution ooo - Thu Jun 26 00:00:00 GMT-0400 2008 mmm - Mon Jun 30 00:00:00 GMT-0400 2008 (com.dynamicmedicalventures.De2ORApplication.vo::CallScheduleVO)#0 callDate = Thu Jun 26 00:00:00 GMT-0400 2008 callLocationID = 5 callScheduleID = 985 callScheduleNote = createdBy = 1 createdDTS = Wed May 28 04:41:05 GMT-0400 2008 modifiedBy = 0 modifiedDTS = (null) userID = 25 false ooo - Fri Jun 27 00:00:00 GMT-0400 2008 mmm - Mon Jun 30 00:00:00 GMT-0400 2008 (com.dynamicmedicalventures.De2ORApplication.vo::CallScheduleVO)#0 callDate = Fri Jun 27 00:00:00 GMT-0400 2008 callLocationID = 5 callScheduleID = 986 callScheduleNote = createdBy = 1 createdDTS = Wed May 28 04:41:05 GMT-0400 2008 modifiedBy = 0 modifiedDTS = (null) userID = 2 false ooo - Mon Jun 30 00:00:00 GMT-0400 2008 mmm - Mon Jun 30 00:00:00 GMT-0400 2008 (com.dynamicmedicalventures.De2ORApplication.vo::CallScheduleVO)#0 callDate = Mon Jun 30 00:00:00 GMT-0400 2008 callLocationID = 5 callScheduleID = 987 callScheduleNote = createdBy = 1 createdDTS = Wed May 28 04:41:05 GMT-0400 2008 modifiedBy = 0 modifiedDTS = (null) userID = 7 false When this function runs through all of the data, I am left with an empty array for the filtering. I can not understand why the last group of data, where the two dates are identical does not return true and therefore be included in the filtered array. Does anyone have an idea of what I am doing wrong with this Thanks Don
Re: [flexcoders] Strange behavior with array filter function
U r trying to compare the references instead of actual values. Try to compare the actual values and not the references Thanks, with Regards, Jitendra Jain Software Engineer 91-9979960798 - Original Message From: donvoltz [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, June 14, 2008 8:22:24 AM Subject: [flexcoders] Strange behavior with array filter function Can anyone tell me what I am doing wrong with this filter function. I am passing in an array of valueObjects into the following filter function public static function filterCallSchedule( o:*, index:int, arr:Array):Boolean { var modelLocator: AppModelLocator = AppModelLocator. getInstance( ); trace('ooo - ' + o.callDate); trace('mmm - ' + modelLocator. currentlySelecte dCallDate) ; trace(ObjectUtil. toString( o)); if (o.callDate == modelLocator. currentlySelecte dCallDate) { trace(true); return true; } else { trace(false) ; return false; } } This is some of the data returned as I trace this functions execution ooo - Thu Jun 26 00:00:00 GMT-0400 2008 mmm - Mon Jun 30 00:00:00 GMT-0400 2008 (com.dynamicmedical ventures. De2ORApplication .vo::CallSchedul eVO)#0 callDate = Thu Jun 26 00:00:00 GMT-0400 2008 callLocationID = 5 callScheduleID = 985 callScheduleNote = createdBy = 1 createdDTS = Wed May 28 04:41:05 GMT-0400 2008 modifiedBy = 0 modifiedDTS = (null) userID = 25 false ooo - Fri Jun 27 00:00:00 GMT-0400 2008 mmm - Mon Jun 30 00:00:00 GMT-0400 2008 (com.dynamicmedical ventures. De2ORApplication .vo::CallSchedul eVO)#0 callDate = Fri Jun 27 00:00:00 GMT-0400 2008 callLocationID = 5 callScheduleID = 986 callScheduleNote = createdBy = 1 createdDTS = Wed May 28 04:41:05 GMT-0400 2008 modifiedBy = 0 modifiedDTS = (null) userID = 2 false ooo - Mon Jun 30 00:00:00 GMT-0400 2008 mmm - Mon Jun 30 00:00:00 GMT-0400 2008 (com.dynamicmedical ventures. De2ORApplication .vo::CallSchedul eVO)#0 callDate = Mon Jun 30 00:00:00 GMT-0400 2008 callLocationID = 5 callScheduleID = 987 callScheduleNote = createdBy = 1 createdDTS = Wed May 28 04:41:05 GMT-0400 2008 modifiedBy = 0 modifiedDTS = (null) userID = 7 false When this function runs through all of the data, I am left with an empty array for the filtering. I can not understand why the last group of data, where the two dates are identical does not return true and therefore be included in the filtered array. Does anyone have an idea of what I am doing wrong with this Thanks Don
Re: [flexcoders] Strange behavior with array filter function
=== and !== operators to verify that both comparison objects are of the same type, with the same content: Thanks, with Regards, Jitendra Jain Software Engineer 91-9979960798 - Original Message From: donvoltz [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, June 14, 2008 8:22:24 AM Subject: [flexcoders] Strange behavior with array filter function Can anyone tell me what I am doing wrong with this filter function. I am passing in an array of valueObjects into the following filter function public static function filterCallSchedule( o:*, index:int, arr:Array):Boolean { var modelLocator: AppModelLocator = AppModelLocator. getInstance( ); trace('ooo - ' + o.callDate); trace('mmm - ' + modelLocator. currentlySelecte dCallDate) ; trace(ObjectUtil. toString( o)); if (o.callDate == modelLocator. currentlySelecte dCallDate) { trace(true); return true; } else { trace(false) ; return false; } } This is some of the data returned as I trace this functions execution ooo - Thu Jun 26 00:00:00 GMT-0400 2008 mmm - Mon Jun 30 00:00:00 GMT-0400 2008 (com.dynamicmedical ventures. De2ORApplication .vo::CallSchedul eVO)#0 callDate = Thu Jun 26 00:00:00 GMT-0400 2008 callLocationID = 5 callScheduleID = 985 callScheduleNote = createdBy = 1 createdDTS = Wed May 28 04:41:05 GMT-0400 2008 modifiedBy = 0 modifiedDTS = (null) userID = 25 false ooo - Fri Jun 27 00:00:00 GMT-0400 2008 mmm - Mon Jun 30 00:00:00 GMT-0400 2008 (com.dynamicmedical ventures. De2ORApplication .vo::CallSchedul eVO)#0 callDate = Fri Jun 27 00:00:00 GMT-0400 2008 callLocationID = 5 callScheduleID = 986 callScheduleNote = createdBy = 1 createdDTS = Wed May 28 04:41:05 GMT-0400 2008 modifiedBy = 0 modifiedDTS = (null) userID = 2 false ooo - Mon Jun 30 00:00:00 GMT-0400 2008 mmm - Mon Jun 30 00:00:00 GMT-0400 2008 (com.dynamicmedical ventures. De2ORApplication .vo::CallSchedul eVO)#0 callDate = Mon Jun 30 00:00:00 GMT-0400 2008 callLocationID = 5 callScheduleID = 987 callScheduleNote = createdBy = 1 createdDTS = Wed May 28 04:41:05 GMT-0400 2008 modifiedBy = 0 modifiedDTS = (null) userID = 7 false When this function runs through all of the data, I am left with an empty array for the filtering. I can not understand why the last group of data, where the two dates are identical does not return true and therefore be included in the filtered array. Does anyone have an idea of what I am doing wrong with this Thanks Don
[flexcoders] Strange behavior
I am trying to implement a checkbox as a headerRenderer: public class CheckBoxHeaderRenderer extends CheckBox { private var _parentGrid:DataGrid = new DataGrid(); public function CheckBoxHeaderRenderer() { super(); selected = true; addEventListener(click, clickHandler); } override protected function clickHandler (event:MouseEvent):void { super.clickHandler(event); parentGrid.dataProvider[0].processorder = 10; } public function set parentGrid(value:DataGrid):void { _parentGrid = value; } public function get parentGrid():DataGrid { return _parentGrid; } } That works fine except that when I click on a checkbox it does not lose it check mark. Commenting out: parentGrid.dataProvider[0].processorder = 10; will resore checkbox's behavior. What am I missing? Thanks
RE: [flexcoders] Strange behavior
Even headerRenderers get recycled. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of markgoldin_2000 Sent: Tuesday, May 06, 2008 2:23 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Strange behavior I am trying to implement a checkbox as a headerRenderer: public class CheckBoxHeaderRenderer extends CheckBox { private var _parentGrid:DataGrid = new DataGrid(); public function CheckBoxHeaderRenderer() { super(); selected = true; addEventListener(click, clickHandler); } override protected function clickHandler (event:MouseEvent):void { super.clickHandler(event); parentGrid.dataProvider[0].processorder = 10; } public function set parentGrid(value:DataGrid):void { _parentGrid = value; } public function get parentGrid():DataGrid { return _parentGrid; } } That works fine except that when I click on a checkbox it does not lose it check mark. Commenting out: parentGrid.dataProvider[0].processorder = 10; will resore checkbox's behavior. What am I missing? Thanks
RE: [flexcoders] Strange behavior....
While not precisely intuitive, that is expected behavior. I looked for a technical explanation but didn't find one immediately. As I recall, it is because the argument to the Boolean() cast is an object, and an object containing a string is always true. It would be false if the object were null. Use this instead: (myString == true) Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Marvin Froeder Sent: Monday, February 04, 2008 3:01 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Strange behavior I'm making some test with Boolean Flex cast. See: ?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 initialize=main() mx:Script ![CDATA[ private function main():void { trace(Boolean: + Boolean(true)); trace(Boolean: + Boolean(false)); } ]] /mx:Script /mx:Application I expect true and false on console. But I got: [SWF] C:\framework\workspace\CobaiaFlex\bin\BooleanTest.swf - 445.501 bytes after decompression Boolean: true Boolean: true What happened? Marvin
[flexcoders] Strange behavior....
I'm making some test with Boolean Flex cast. See: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute initialize=main() mx:Script ![CDATA[ private function main():void { trace(Boolean: + Boolean(true)); trace(Boolean: + Boolean(false)); } ]] /mx:Script /mx:Application I expect true and false on console. But I got: [SWF] C:\framework\workspace\CobaiaFlex\bin\BooleanTest.swf - 445.501 bytes after decompression Boolean: true Boolean: true What happened? Marvin
Re: [flexcoders] Strange behavior....
anything other than 0 is false and i think Boolean's use strict equalities === so false is not the same as false.toString() - Original Message From: Marvin Froeder [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Monday, February 4, 2008 2:00:48 PM Subject: [flexcoders] Strange behavior I'm making some test with Boolean Flex cast. See: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxml layout=absolute initialize=main() mx:Script ![CDATA[ private function main():void { trace(Boolean: + Boolean(true)); trace(Boolean: + Boolean(false)); } ]] /mx:Script /mx:Application I expect true and false on console. But I got: [SWF] C:\framework\ workspace\ CobaiaFlex\ bin\BooleanTest. swf - 445.501 bytes after decompression Boolean: true Boolean: true What happened? Marvin Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Re: [flexcoders] Strange behavior....
You are seeing correct behavior. See: http://livedocs.adobe.com/flex/201/langref/package.html#Boolean() If you want to do what your code intends to do you have to check for the string true manually: (variable == true ? true : false); - Dan Freiman On Feb 4, 2008 3:00 PM, Marvin Froeder [EMAIL PROTECTED] wrote: I'm making some test with Boolean Flex cast. See: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute initialize=main() mx:Script ![CDATA[ private function main():void { trace(Boolean: + Boolean(true)); trace(Boolean: + Boolean(false)); } ]] /mx:Script /mx:Application I expect true and false on console. But I got: [SWF] C:\framework\workspace\CobaiaFlex\bin\BooleanTest.swf - 445.501bytes after decompression Boolean: true Boolean: true What happened? Marvin
Re: [flexcoders] Strange behavior....
meant anything other than 0 and false is true but it cant be false - Original Message From: Marvin Froeder [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Monday, February 4, 2008 2:00:48 PM Subject: [flexcoders] Strange behavior I'm making some test with Boolean Flex cast. See: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxml layout=absolute initialize=main() mx:Script ![CDATA[ private function main():void { trace(Boolean: + Boolean(true)); trace(Boolean: + Boolean(false)); } ]] /mx:Script /mx:Application I expect true and false on console. But I got: [SWF] C:\framework\ workspace\ CobaiaFlex\ bin\BooleanTest. swf - 445.501 bytes after decompression Boolean: true Boolean: true What happened? Marvin Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Re: [flexcoders] Strange behavior....
So it dont work like int(), Number() and String() Very, very cool =/ VELO On Feb 4, 2008 6:35 PM, Sherif Abdou [EMAIL PROTECTED] wrote: meant anything other than 0 and false is true but it cant be false - Original Message From: Marvin Froeder [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Monday, February 4, 2008 2:00:48 PM Subject: [flexcoders] Strange behavior I'm making some test with Boolean Flex cast. See: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxmlhttp://www.adobe.com/2006/mxml layout=absolute initialize=main() mx:Script ![CDATA[ private function main():void { trace(Boolean: + Boolean(true)); trace(Boolean: + Boolean(false)); } ]] /mx:Script /mx:Application I expect true and false on console. But I got: [SWF] C:\framework\ workspace\ CobaiaFlex\ bin\BooleanTest. swf - 445.501bytes after decompression Boolean: true Boolean: true What happened? Marvin -- Never miss a thing. Make Yahoo your homepage.http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs
[flexcoders] strange behavior with Horizontal Axis on BarChart
I have 2 charts on a page, one shows company projects with a DateTimeAxis showing a timeline from start date to finish date. The other chart shows company events with DateTimeAxis, but the minimum and maximum are read from the min and max off the first charts DateTimeAxis. This way it displays the exact timeline in both. I have the Horizontal Axis on one at the top and the other at the bottom. It looks real nice with one exception... The Events chart (chart 2), even though I have 12 points set as the fontSize doesn't keep a consistent size. In fact if there's only one item in that chart is shows it so small that it's unreadable. What can I do to make sure the size sticks? Also, in order to keep the bars at a consistent size I'm sizing the charts depending on the number of projects or events. That code looks like what I have below. What can I do to keep the Axis at the same size no matter what size the chart is? Thanks! mx:BarChart id=eventChart updateComplete=getEventChartSize (event)... public function getEventChartSize(evt:Event):void { if (parentDocument.eventsArr.length = 1) { evt.target.height = (parentDocument.eventsArr.length * 22)+ 60; } else { evt.target.height = 0; } }
[flexcoders] Strange behavior of CheckBox as itemEditor of DataGrid
Hi guys, My DataGrid is listening to itemEditEnd for each itemEditor change. I have a ComboBox and a CheckBox used as itemEditor components in the datagrid. I'm going to make immediate actions to user interaction, like when change selection of a ComboBox, once user select another value, application immediately make a request to server and continue something upon response. The ComboBox works well for me, when there's a 'close' event I simply move focus out of that itemEditorInstance, itemEditEnd function activated without problem. But the CheckBox behavior is quite strange, when I click on it, if checkbox.selected change to false, itemEditEnd function won't do anything; but when click on and checkbox.selected=true, itemEditEnd immediately get the event. I don't understand how CheckBox ate the focusManager changes. Source code followed, I tried different ways from simple CheckBox component to custom component but no luck. Any help appreciated. Thanks, George - DataGrid component class: mx:DataGridColumn headerText=Enable itemRenderer=EnableEdit rendererIsEditor=true editorDataField=selected dataField=enable width=50 sortable=false/ private function itemEditEndHandler(e:DataGridEvent):void { trace('get it?'); var grid:DataGrid = e.currentTarget as DataGrid; var pos:Object = grid.editedItemPosition; trace(pos.rowIndex); // something to do } EnableEdit.mxml: ?xml version=1.0 encoding=utf-8? mx:HBox xmlns:mx=http://www.adobe.com/2006/mxml; horizontalAlign=center dataChange=this.update() creationComplete=init() mx:Script ![CDATA[ import mx.binding.utils.BindingUtils; [Bindable] public var selected:Boolean; private function init():void { this.update(); //BindingUtils.bindProperty(this, 'check', this.checkBox, 'selected'); } private function update():void { this.selected = data.enable; this.checkBox.selected = this.selected; } /* public function set check(b:Boolean):void { if(this.selected != b){ trace('changed?'); this.selected = b; //change focus will dispatch itemEditEnd event or whatever. RouterModelLocator.getInstance().application.mainView.setFocus(); } }*/ private function clicked():void { trace('clicked'); //this.checkBox.setFocus(); TestModelLocator.getInstance().application.mainView.setFocus(); } ]] /mx:Script mx:CheckBox id=checkBox click=this.clicked()/ /mx:HBox
Re: [flexcoders] Strange behavior of CheckBox as itemEditor of DataGrid
You probably want to make that column non editable editable=false and just put a handler on the click event... click=doSomething(event). hth Scott Scott Melby Founder, Fast Lane Software LLC http://www.fastlanesw.com George wrote: Hi guys, My DataGrid is listening to itemEditEnd for each itemEditor change. I have a ComboBox and a CheckBox used as itemEditor components in the datagrid. I'm going to make immediate actions to user interaction, like when change selection of a ComboBox, once user select another value, application immediately make a request to server and continue something upon response. The ComboBox works well for me, when there's a 'close' event I simply move focus out of that itemEditorInstance, itemEditEnd function activated without problem. But the CheckBox behavior is quite strange, when I click on it, if checkbox.selected change to false, itemEditEnd function won't do anything; but when click on and checkbox.selected=true, itemEditEnd immediately get the event. I don't understand how CheckBox ate the focusManager changes. Source code followed, I tried different ways from simple CheckBox component to custom component but no luck. Any help appreciated. Thanks, George - DataGrid component class: mx:DataGridColumn headerText=Enable itemRenderer=EnableEdit rendererIsEditor=true editorDataField=selected dataField=enable width=50 sortable=false/ private function itemEditEndHandler(e:DataGridEvent):void { trace('get it?'); var grid:DataGrid = e.currentTarget as DataGrid; var pos:Object = grid.editedItemPosition; trace(pos.rowIndex); // something to do } EnableEdit.mxml: ?xml version=1.0 encoding=utf-8? mx:HBox xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml horizontalAlign=center dataChange=this.update() creationComplete=init() mx:Script ![CDATA[ import mx.binding.utils.BindingUtils; [Bindable] public var selected:Boolean; private function init():void { this.update(); //BindingUtils.bindProperty(this, 'check', this.checkBox, 'selected'); } private function update():void { this.selected = data.enable; this.checkBox.selected = this.selected; } /* public function set check(b:Boolean):void { if(this.selected != b){ trace('changed?'); this.selected = b; //change focus will dispatch itemEditEnd event or whatever. RouterModelLocator.getInstance().application.mainView.setFocus(); } }*/ private function clicked():void { trace('clicked'); //this.checkBox.setFocus(); TestModelLocator.getInstance().application.mainView.setFocus(); } ]] /mx:Script mx:CheckBox id=checkBox click=this.clicked()/ /mx:HBox
Re: [flexcoders] Strange behavior of CheckBox as itemEditor of DataGrid
Sorry... responded too soon and didn't see source code below :( Scott Scott Melby Founder, Fast Lane Software LLC http://www.fastlanesw.com Scott Melby wrote: You probably want to make that column non editable editable=false and just put a handler on the click event... click=doSomething(event). hth Scott Scott Melby Founder, Fast Lane Software LLC http://www.fastlanesw.com George wrote: Hi guys, My DataGrid is listening to itemEditEnd for each itemEditor change. I have a ComboBox and a CheckBox used as itemEditor components in the datagrid. I'm going to make immediate actions to user interaction, like when change selection of a ComboBox, once user select another value, application immediately make a request to server and continue something upon response. The ComboBox works well for me, when there's a 'close' event I simply move focus out of that itemEditorInstance, itemEditEnd function activated without problem. But the CheckBox behavior is quite strange, when I click on it, if checkbox.selected change to false, itemEditEnd function won't do anything; but when click on and checkbox.selected=true, itemEditEnd immediately get the event. I don't understand how CheckBox ate the focusManager changes. Source code followed, I tried different ways from simple CheckBox component to custom component but no luck. Any help appreciated. Thanks, George - DataGrid component class: mx:DataGridColumn headerText=Enable itemRenderer=EnableEdit rendererIsEditor=true editorDataField=selected dataField=enable width=50 sortable=false/ private function itemEditEndHandler(e:DataGridEvent):void { trace('get it?'); var grid:DataGrid = e.currentTarget as DataGrid; var pos:Object = grid.editedItemPosition; trace(pos.rowIndex); // something to do } EnableEdit.mxml: ?xml version=1.0 encoding=utf-8? mx:HBox xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml horizontalAlign=center dataChange=this.update() creationComplete=init() mx:Script ![CDATA[ import mx.binding.utils.BindingUtils; [Bindable] public var selected:Boolean; private function init():void { this.update(); //BindingUtils.bindProperty(this, 'check', this.checkBox, 'selected'); } private function update():void { this.selected = data.enable; this.checkBox.selected = this.selected; } /* public function set check(b:Boolean):void { if(this.selected != b){ trace('changed?'); this.selected = b; //change focus will dispatch itemEditEnd event or whatever. RouterModelLocator.getInstance().application.mainView.setFocus(); } }*/ private function clicked():void { trace('clicked'); //this.checkBox.setFocus(); TestModelLocator.getInstance().application.mainView.setFocus(); } ]] /mx:Script mx:CheckBox id=checkBox click=this.clicked()/ /mx:HBox
Re: [flexcoders] Strange behavior of CheckBox as itemEditor of DataGrid (Fixed)
Thanks Scott, I fixed it myself. Another _callLater___ issue. George Scott Melby wrote: Sorry... responded too soon and didn't see source code below :( Scott Scott Melby Founder, Fast Lane Software LLC http://www.fastlanesw.com Scott Melby wrote: You probably want to make that column non editable editable=false and just put a handler on the click event... click=doSomething(event). hth Scott Scott Melby Founder, Fast Lane Software LLC http://www.fastlanesw.com George wrote: Hi guys, My DataGrid is listening to itemEditEnd for each itemEditor change. I have a ComboBox and a CheckBox used as itemEditor components in the datagrid. I'm going to make immediate actions to user interaction, like when change selection of a ComboBox, once user select another value, application immediately make a request to server and continue something upon response. The ComboBox works well for me, when there's a 'close' event I simply move focus out of that itemEditorInstance, itemEditEnd function activated without problem. But the CheckBox behavior is quite strange, when I click on it, if checkbox.selected change to false, itemEditEnd function won't do anything; but when click on and checkbox.selected=true, itemEditEnd immediately get the event. I don't understand how CheckBox ate the focusManager changes. Source code followed, I tried different ways from simple CheckBox component to custom component but no luck. Any help appreciated. Thanks, George - DataGrid component class: mx:DataGridColumn headerText=Enable itemRenderer=EnableEdit rendererIsEditor=true editorDataField=selected dataField=enable width=50 sortable=false/ private function itemEditEndHandler(e:DataGridEvent):void { trace('get it?'); var grid:DataGrid = e.currentTarget as DataGrid; var pos:Object = grid.editedItemPosition; trace(pos.rowIndex); // something to do } EnableEdit.mxml: ?xml version=1.0 encoding=utf-8? mx:HBox xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml horizontalAlign=center dataChange=this.update() creationComplete=init() mx:Script ![CDATA[ import mx.binding.utils.BindingUtils; [Bindable] public var selected:Boolean; private function init():void { this.update(); //BindingUtils.bindProperty(this, 'check', this.checkBox, 'selected'); } private function update():void { this.selected = data.enable; this.checkBox.selected = this.selected; } /* public function set check(b:Boolean):void { if(this.selected != b){ trace('changed?'); this.selected = b; //change focus will dispatch itemEditEnd event or whatever. RouterModelLocator.getInstance().application.mainView.setFocus(); } }*/ private function clicked():void { trace('clicked'); //this.checkBox.setFocus(); TestModelLocator.getInstance().application.mainView.setFocus(); } ]] /mx:Script mx:CheckBox id=checkBox click=this.clicked()/ /mx:HBox
Re: [flexcoders] Strange Behavior on DataGrid Resize - Column Resize below Minimum Width
I am struggling with a very strange behavior: I have a dataGrid Are you using the 2.0.1-hotfix 1 compiler, or just 2.0.1 ? Hotfix 1 has several updates to the DataGrid. -- Tom Chiverton Helping to biannually utilize cross-platform convergence on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.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 * 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/
[flexcoders] Strange Behavior on DataGrid Resize - Column Resize below Minimum Width
Hello all, I am struggling with a very strange behavior: I have a dataGrid with some 15 columns. The grid's horizontalScrollPolicy is set to auto. This should add a horizontal scrollbar when the conrtrol's client area width is smaller than the column widths added together. So far so good. Now, when I resize the DataGrid (by changing the width property), it seems that the most right visible COLUMN in the resized grid, gets resized as well - probably in an attempt to align the right column border with the right border of the current view container. Just to clarify: it's not the last Column of the grid, it's the right most Column you can currently see with the scrollbar all the way left (zero position). This column resize will even happen, when the resulting column width is smaller than the minWidth value, basically ignoring the minWidth property. Has anyone seen and dealt with this before? Thanks a million -Iko
[flexcoders] Strange behavior with Apache/Tomcat over SSL
I have Apache and Tomcat integrated using mod_jk (ajp13). I also have mod_ssl loaded in Apache. I have a web application in Tomcat that is protected via forms authentication. The Main page of the web application displays a Flex app. Everything works fine over HTTP, I'm prompted to authenticate and after I do the Flex app displays. The strange thing is when I try it over HTTPS. I get prompted to authenticate, and after I do I get the page that contains the Flex app, but no Flex app. The Flash Player context menu is available (in IE it indicates the movie not loaded...), but not my app. When I look at the log file for Apache it indicates all the auxiliary files were returned OK (HTTP 200), but the SWF was not (HTTP 400). Not sure why, but it returns 16K for the request even though the move is 400K. Any thoughts? I'm at a loss. Here's the log entries... Thanks. -Steven 127.0.0.1 - - [26/Feb/2007:16:32:50 -0500] GET /MyWebApp/app/ HTTP/1.1 200 1250 127.0.0.1 - - [26/Feb/2007:16:32:56 - 0500] POST /MyWebApp/app/j_security_check;jsessionid=548A2CA7D771101D 218AEA5F4618D9E7 HTTP/1.1 302 - 127.0.0.1 - - [26/Feb/2007:16:32:58 -0500] GET /MyWebApp/app/ HTTP/1.1 200 4237 127.0.0.1 - - [26/Feb/2007:16:32:58 - 0500] GET /MyWebApp/app/AC_OETags.js HTTP/1.1 200 7826 127.0.0.1 - - [26/Feb/2007:16:32:58 - 0500] GET /MyWebApp/app/history.js HTTP/1.1 200 1292 127.0.0.1 - - [26/Feb/2007:16:32:58 - 0500] GET /MyWebApp/app/MyFlexApp.swf HTTP/1.1 400 16368 127.0.0.1 - - [26/Feb/2007:16:32:58 - 0500] GET /MyWebApp/app/history.htm HTTP/1.1 200 1272 127.0.0.1 - - [26/Feb/2007:16:32:58 - 0500] GET /MyWebApp/app/history.swf HTTP/1.1 200 2656
RE: [flexcoders] Strange behavior with Apache/Tomcat over SSL
This is a known issue with IE, HTTPS and Auth headers. Add the following to your context.xml in meta-inf. Valve className=org.apache.catalina.authenticator.FormAuthenticator disableProxyCaching=false / Restart tomcat and it will start working for you. Carson Carson Hager Cynergy Systems, Inc. http://www.cynergysystems.com http://www.cynergysystems.com/ Email: [EMAIL PROTECTED] Office: 866-CYNERGY Mobile: 1.703.489.6466 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steven Toth Sent: Monday, February 26, 2007 2:03 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Strange behavior with Apache/Tomcat over SSL I have Apache and Tomcat integrated using mod_jk (ajp13). I also have mod_ssl loaded in Apache. I have a web application in Tomcat that is protected via forms authentication. The Main page of the web application displays a Flex app. Everything works fine over HTTP, I'm prompted to authenticate and after I do the Flex app displays. The strange thing is when I try it over HTTPS. I get prompted to authenticate, and after I do I get the page that contains the Flex app, but no Flex app. The Flash Player context menu is available (in IE it indicates the movie not loaded...), but not my app. When I look at the log file for Apache it indicates all the auxiliary files were returned OK (HTTP 200), but the SWF was not (HTTP 400). Not sure why, but it returns 16K for the request even though the move is 400K. Any thoughts? I'm at a loss. Here's the log entries... Thanks. -Steven 127.0.0.1 - - [26/Feb/2007:16:32:50 -0500] GET /MyWebApp/app/ HTTP/1.1 200 1250 127.0.0.1 - - [26/Feb/2007:16:32:56 - 0500] POST /MyWebApp/app/j_security_check;jsessionid=548A2CA7D771101D 218AEA5F4618D9E7 HTTP/1.1 302 - 127.0.0.1 - - [26/Feb/2007:16:32:58 -0500] GET /MyWebApp/app/ HTTP/1.1 200 4237 127.0.0.1 - - [26/Feb/2007:16:32:58 - 0500] GET /MyWebApp/app/AC_OETags.js HTTP/1.1 200 7826 127.0.0.1 - - [26/Feb/2007:16:32:58 - 0500] GET /MyWebApp/app/history.js HTTP/1.1 200 1292 127.0.0.1 - - [26/Feb/2007:16:32:58 - 0500] GET /MyWebApp/app/MyFlexApp.swf HTTP/1.1 400 16368 127.0.0.1 - - [26/Feb/2007:16:32:58 - 0500] GET /MyWebApp/app/history.htm HTTP/1.1 200 1272 127.0.0.1 - - [26/Feb/2007:16:32:58 - 0500] GET /MyWebApp/app/history.swf HTTP/1.1 200 2656
[flexcoders] Strange behavior in datagrid
I have a datagrid in my app that is displaying one row of data BELOW the actual visible control. Any idea what could cause something likethat? __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
[flexcoders] Strange behavior on mx:TextArea
I think TextArea component is a very simple one. And I use this component any place in my application built with Flex 2. However in particular case, i got following error popup. TypeError: Error #1034: Type Coersion failed: cannot convert flash.events::[EMAIL PROTECTED] to mx.events.IndexChangedEvent Used code is following - yes, it's too simple... mx:FormItem label=desc width=80% mx:TextArea id=description/ /mx:FormItem Even though I use exact same code(above) at several place, i got above error message not every place, but at particular place. Could it be possible? I totally am confused Any comment would be appreciated. -k Yahoo! Groups Sponsor ~-- Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/2jUsvC/tzNLAA/TtwFAA/nhFolB/TM ~- -- 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/ * 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] Strange behavior on mx:TextArea
Hi, I think, that error is because of something else instead of this code. This error is because of improper casting... Can you post the complete code? -abdul From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of keishichi2001Sent: Friday, December 16, 2005 2:16 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Strange behavior on mx:TextArea I think TextArea component is a very simple one.And I use this component any place in my application built with Flex 2.However in particular case, i got following error popup.TypeError: Error #1034: Type Coersion failed: cannot convertflash.events::[EMAIL PROTECTED] to mx.events.IndexChangedEventUsed code is following - yes, it's too simple... mx:FormItem label="desc" width="80%" mx:TextArea id="description"/ /mx:FormItemEven though I use exact same code(above) at several place, i got aboveerror message not every place, but at particular place.Could it be possible?I totally am confusedAny comment would be appreciated.-k -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[flexcoders] Strange behavior of the scroll bar in the Panel
What am I doing wrong that the scroll bar is not showing last 2 labels??? --START OF THE CODE ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; width=400 height=100% vScrollPolicy=off hScrollPolicy=off mx:Model id=res source=resource.xml/ mx:Panel title={res.title} width=100% height=200 vScrollPolicy=on mx:Label text=a height={res.height}/ mx:Label text= height={res.height}/ mx:Label text=cc height={res.height}/ mx:Label text=dd height={res.height}/ mx:Label text=e height={res.height}/ mx:Label text= height={res.height}/ mx:Label text= height={res.height}/ mx:Label text=hhh height={res.height}/ mx:Label text=iii height={res.height}/ mx:Label text= height={res.height}/ mx:Label text= height={res.height}/ mx:Label text=ll height={res.height}/ mx:Label text=mm height={res.height}/ mx:Label text=nnn height={res.height}/ mx:Label text=ooo height={res.height}/ mx:Label text=p height={res.height}/ mx:Label text=r height={res.height}/ mx:ControlBar horizontalAlign=center mx:Label text={res.control_bar_text}/ /mx:ControlBar /mx:Panel /mx:Application --END OF THE CODE Thanks, -Marcin Yahoo! Groups Sponsor ~-- font face=arial size=-1a href=http://us.ard.yahoo.com/SIG=12h21h2kg/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124826464/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992 Fair play? Video games influencing politics. Click and talk back!/a./font ~- -- 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/ * 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/
[flexcoders] Strange Behavior with Font Embeding
I am getting wierd results while trying to embed fonts in my application. Many times it reports: Warning /Penguin/SurveyProperties/EditSurvey.mxml:53 Font not found at: file:C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/flex/Penguin/SurveyProperties/VERDANA.TTF This simply isn't true. The font file IS there and I made sure that the permissions on the file were barn door open wide. Here's the embed lines I am using: mx:Style @font-face { fontFamily: VerdanaBold; src:url(VERDANA.TTF); font-weight: bold; } @font-face { fontFamily: VerdanaNormal; src:url(VERDANA.TTF); font-weight: normal; } /mx:Style I have found this to work fine on some apps, and on others it just breaks like this. I cannot see what the difference is between the working apps and the non-working apps... any insight would be greatly appreciated, thank you, -- Matthew -- 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/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.