[flexcoders] How do I make this custom Style property work correctly?
I'm trying to create a CSS style property that expects an mx:Effect object to be used in a custom AS class. I want to detect changes being made to the style property and assign the specified effect to an effect trigger belonging to a child of my custom component. Unfortunately, the specified mx:Effect object seems to be interpreted as a string instead of an mx:Effect object. Can anyone tell me what I need to correct for this to work as expected? You can see the compiled example here http://tommyb.com/flex/styleeffectbug/index.html and review the source code below. It fails due to a TypeError: Error #1034: Type Coercion failed: cannot convert myTestEffect to mx.effects.Effect.Style in the custom components styleChanged function at the bottom of this post. EffectTest.mxml ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:myComps=myComponents.* layout=absolute viewSourceURL=srcview/index.html mx:Fade id=myTestEffect alphaFrom=0.0 alphaTo=1.0 duration=1000/ mx:Style MyCustomPanel { testEffect: myTestEffect; } /mx:Style myComps:MyCustomPanel/ /mx:Application myComponents/MyCustomPanel.as: package myComponents { import mx.containers.Panel; import mx.effects.Effect; import mx.controls.Alert; [Style(name=testEffect, type=mx.effects.Effect, inherit=no)] public class MyCustomPanel extends Panel { public function MyCustomPanel() { super(); } override public function styleChanged(styleProp:String):void { var allStyles:Boolean = !styleProp || styleProp == styleName; super.styleChanged(styleProp); if (allStyles || styleProp == testEffect) { var theTestEffect:Effect = getStyle(testEffect); if (theTestEffect) Alert.show(Effect assignment successful); } } } }
RE: [flexcoders] Additional charting types
Thanks Ely, I'll give it a try. I was also thinking of adapting AreaChart by specifying minField value and alpha=0 for mx:fill Thanks, Alex -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ely Greenfield Sent: Saturday, November 25, 2006 10:21 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Additional charting types Hi Alex. You should be able to do that with a LineSeries, in a CartesianChart with a LinearAxis for both the horizontal and vertical axes.. Make sure you set sortOnXField to false on the lineSeries though, or else it will sort all of your points by horizontal value before drawing the connecting line. Ely. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex Sent: Friday, November 24, 2006 8:22 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Additional charting types Hi All, Just wondering if anyone knows additional charts developed for Flex. I'm interested in the Scatter chart - looks a bit similar to the Plot Chart but have all plots connected with lines so it finally looks like a polygon. Kind regards, Alex
[flexcoders] Re: Custom Tooltips in actionscript - Correction
John, Thanks for the tips. I think I got it between your help and one spot in the UIComponent help. So the code I was getting caught up in was the line toolTipCreate=event.toolTip=this.createTip() Where createTip created a custom tooltip as described in a number of posts I've seen before. What I failed to understand was that the code is really a small function and equivalent to: onInit(): void{ ... chkbox1.addEventListener(ToolTipEvent.TOOL_TIP_CREATE, onToolTipCreate); } private function onToolTipCreate(thisEvent : ToolTipEvent): void { thisEvent.toolTip = this.createTip(); trace(ToolTipCreate); } So I was able to get this model to display my custom tooltips for my subset of items. On the TOOL_TIP_SHOW event, I can initialize the tooltip components. Thanks for your help, Rich --- In flexcoders@yahoogroups.com, John Kirby [EMAIL PROTECTED] wrote: Correction here. Replace in wToolTip.setComponentClass(AreaCodeSearchWindow) with wToolTip.setComponentObject(AreaCodeSearchWindow); John Kirby said the following: Below is how I handle custom components in a tooltip. weather.WeatherToolTipManager extends ToolTipManager. WeatherToolTip Extend ToolTip . Just create a WeatherToolTip object and use the setComponentClass(UiComponent) to store the custom componet. Then pass the tooltip to the create custom tooltip to allow you to view your component inside a tooltip. ?xml version=1.0 encoding=utf-8? mx:Application backgroundGradientColors=[0xFF,0xFF] backgroundColor=0xFF xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script![CDATA public var wToolTip:WeatherToolTip; private function showTip(event:Event):void { if (WeatherToolTipManager.toolTipOpen){ return; } //Create tooltip and add component to it wToolTip = new WeatherToolTip(); wToolTip.setComponentClass(AreaCodeSearchWindow); // adjust coordinates inside tooltip wToolTip.setCoordinates(20,10); // use custom createCustomToolTip to add tooltip and its component as a child to the tooltipManager // This essentially is the same as the createToolTip except you pass a complex componet vs. text to the tooltip WeatherToolTipManager.createCustomToolTip(event.currentTarget.x + event.currentTarget.width, (event.currentTarget.y +10),wToolTip,errorTipRight); // customize the tooltip wToolTip.setStyle(cornerRadius, 10); wToolTip.setStyle(backgroundAlpha, 0.40); wToolTip.setStyle(backgroundColor, #4ca0d4); wToolTip.setStyle(borderColor, #4ca0d4); wToolTip.setStyle(backgroundGradientColors, [0xFF,0xFF]); } ]]/mx:Script mx:Panel id=myPanel click=showTip(event) /mx:Panel /mx:Application There is a destroy method to close/remove the tooltip. This could be called by a button component inside the tooltip or handled via a rollover/out event. public class WeatherToolTipManager extends ToolTipManager{ public static var toolTipOpen:Boolean = false; public static var currentToolTip:IToolTip; public static function createCustomToolTip(x:Number, y:Number, wToolTip:ToolTip, errorTipBorderStyle:String = null, context:IUIComponent = null):void{ var sm:ISystemManager = context ? context.systemManager : Application.application.systemManager; sm.toolTipChildren.addChild(wToolTip); if (errorTipBorderStyle){ wToolTip.setStyle(borderStyle, errorTipBorderStyle); } currentToolTip = wToolTip; wToolTip.move(x, y); toolTipOpen = true; } public static function destroyToolTip(toolTip:IToolTip):void{ var sm:ISystemManager = toolTip.systemManager; sm.toolTipChildren.removeChild(DisplayObject(toolTip)); toolTipOpen = false; } } public class WeatherToolTip extends ToolTip { private var tipClass:Class; private var tipX:int; private var tipY:int; private var classInstance:Object; public function WeatherToolTip(){ super(); //
[flexcoders] resizing the datagrid ?
Hi , I facing a lot of problem for resizing the datagrid. I have created a datagrid component which I am placing in a HBox. I have to set the size of datagrid in percentage to make it resizable. Can anyone tell me what properties of datagrid can I set in percentage, I need to keep rowcount constant, that means rowheight will vary, now if I set pecentageHeight to some value say 90%, it calculates the rowheight and also the rowcount on it's own, so sometimes I get a extra empty row at the bottom and sometimes the last row appears half.
[flexcoders] Marker ID #### not found
Hi there, I am kind of new to Flex (but not to ColdFusion). I have been playing around with Flex 2 during the last days and so far I find it very future-promissing platform, worth investing some time on it. I have a small problem which I have no clue what's wrong. As soon as I try to execute my mxml application I (sometimes) get this error marker id #(some id)# not found. Am I doing something wrong? thanks a lot!! George
RE: [flexcoders] IP Address Validation
This is Regular Expression from AS3CB: ^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4 ]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$ -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tom Chiverton Sent: 24 ?? 2006 ?. 16:02 To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] IP Address Validation On Friday 24 November 2006 07:15, KP wrote: I am looking forward to user input. Check there are 3 dots Split the string on the dots, check there are 4 items. Check each item is 0=n=255. You could combine anywhere betwen none and all of the above into one test using regular expressions. -- Tom Chiverton Helping to simultaneously utilize turn-key models 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 -- 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] Getting Code Hinting to work from Library
Is there any way to get the code hinting to work from an included library? I've compiled all my image and font assets in a library swc and have included it in my project (merge-in). But now I'm no longer able to get the code-hinting, and without it, remember names of all the various images that used to appear in the code hints is a real pain. Is there something else I can do to get code-hinting to work again? Thanks, Bruce
[flexcoders] Data binding nested data??? BUG???
All, Does anyone understand why this databinding doesn't work. It seems like this is a significant bug. Example shows a form with several fields, a data model, bindings, a grid and a second form to echo the data. Clearly the bindings work as the second form echos the first, the top level objects, email and description also work, it's the nested objects that don't work on the grid. This the datagrid does work as I would I would expect: Any thoughts would be appreciated. !-- Example-- ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute !-- Form contains user input controls. -- mx:Form label=Employee Information mx:FormItem label=First Name mx:TextInput id=firstName/ /mx:FormItem mx:FormItem label=Last Name mx:TextInput id=lastName/ /mx:FormItem mx:FormItem label=Department mx:TextInput id=department/ /mx:FormItem mx:FormItem label=Email Address mx:TextInput id=email/ /mx:FormItem /mx:Form !-- The myEmployee data model. -- mx:Model id=myEmployee Employee name first/ last/ /name department/ email/ /Employee /mx:Model mx:Binding source=firstName.text destination=myEmployee.name.first/ mx:Binding source=lastName.text destination=myEmployee.name.last/ mx:Binding source=department.text destination=myEmployee.department/ mx:Binding source=email.text destination=myEmployee.email/ mx:DataGrid x=394 y=0 dataProvider={myEmployee} mx:columns mx:DataGridColumn headerText=First Name dataField=name.first/ mx:DataGridColumn headerText=Last Name dataField=name.last/ mx:DataGridColumn headerText=Department dataField=department/ mx:DataGridColumn headerText=Email dataField=email/ /mx:columns /mx:DataGrid mx:Form label=Employee Information Echo x=10 y=156 mx:FormItem label=First Name mx:TextInput text={myEmployee.name.first}/ /mx:FormItem mx:FormItem label=Last Name mx:TextInput text={myEmployee.name.last}/ /mx:FormItem mx:FormItem label=Department mx:TextInput text={myEmployee.department}/ /mx:FormItem mx:FormItem label=Email Address mx:TextInput text={myEmployee.email}/ /mx:FormItem /mx:Form /mx:Application
[flexcoders] GLOBAL functions?
Hello, I've got some functions and variables in my main MXML file that I need to access from other MXMLs in the project. For some reason, I can't seem to figure out how to do this. I've (obviously) checked the documentation looking for a 'global' keyword, or for an 'extern' keyword or for some other way to do this. I'm sure I'm missing something obvious. Could someone point me in the right direction? Thanks in advance, Steve Steve Kellogg Peak8 Solutions 1401 14th Street Boulder, Colorado 80302, USA Fax: 303.415.2597 E-Mail: [EMAIL PROTECTED]
Re: [flexcoders] GLOBAL functions?
use mx.control.Application.application to access the variable. No globals are there in AS-3 jignesh dodiya On 11/25/06, Steve Kellogg @ Project SOC [EMAIL PROTECTED] wrote: Hello, I've got some functions and variables in my main MXML file that I need to access from other MXMLs in the project. For some reason, I can't seem to figure out how to do this. I've (obviously) checked the documentation looking for a 'global' keyword, or for an 'extern' keyword or for some other way to do this. I'm sure I'm missing something obvious. Could someone point me in the right direction? Thanks in advance, Steve Steve Kellogg Peak8 Solutions 1401 14th Street Boulder, Colorado 80302, USA Fax: 303.415.2597 E-Mail: [EMAIL PROTECTED] -- Regards, Jignesh Dodiya
RE: [flexcoders] GLOBAL functions?
Jignesh, Thanks VERY MUCH. Steve _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jignesh Dodiya Sent: Saturday, November 25, 2006 10:21 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] GLOBAL functions? use mx.control.Application.application to access the variable. No globals are there in AS-3 jignesh dodiya On 11/25/06, Steve Kellogg @ Project SOC [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] com wrote: Hello, I've got some functions and variables in my main MXML file that I need to access from other MXMLs in the project. For some reason, I can't seem to figure out how to do this. I've (obviously) checked the documentation looking for a 'global' keyword, or for an 'extern' keyword or for some other way to do this. I'm sure I'm missing something obvious. Could someone point me in the right direction? Thanks in advance, Steve Steve Kellogg Peak8 Solutions 1401 14th Street Boulder, Colorado 80302, USA Fax: 303.415.2597 E-Mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] com -- Regards, Jignesh Dodiya
RE: [flexcoders] resizing the datagrid ?
I ended up having to calculate out the datagrid height after I populated it... the code looked something like this: populateGrid(event:ResultEvent):void { acGridData = event.resut as ArrayCollection; callLater(resizeGrid); } resizeGrid():void { myGrid.height = myGrid.measureHeightOfItems(-1,myGrid.dataProvider.length + 1); } I also had to set myGrid's verticalScrollPolicy = off I had to callLater because the calculation was always wrong otherwise. Shan _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of arpan srivastava Sent: Saturday, November 25, 2006 5:59 AM To: Flex Coders; Flex Components Subject: [flexcoders] resizing the datagrid ? Hi , I facing a lot of problem for resizing the datagrid. I have created a datagrid component which I am placing in a HBox. I have to set the size of datagrid in percentage to make it resizable. Can anyone tell me what properties of datagrid can I set in percentage, I need to keep rowcount constant, that means rowheight will vary, now if I set pecentageHeight to some value say 90%, it calculates the rowheight and also the rowcount on it's own, so sometimes I get a extra empty row at the bottom and sometimes the last row appears half.
RE: [Junk E-Mail - LOW] [flexcoders] GLOBAL functions?
You'll want to create a new actionscript class. In there, you can create your functions, and then in whatever files you need, you can just do an: include com.mycompany.myglobalfunctions And make the call: com.mycompany.myglobalfunctions.someMethod(); Shan _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steve Kellogg @ Project SOC Sent: Saturday, November 25, 2006 11:05 AM To: flexcoders@yahoogroups.com Subject: [Junk E-Mail - LOW] [flexcoders] GLOBAL functions? Hello, I've got some functions and variables in my main MXML file that I need to access from other MXMLs in the project. For some reason, I can't seem to figure out how to do this. I've (obviously) checked the documentation looking for a 'global' keyword, or for an 'extern' keyword or for some other way to do this. I'm sure I'm missing something obvious. Could someone point me in the right direction? Thanks in advance, Steve Steve Kellogg Peak8 Solutions 1401 14th Street Boulder, Colorado 80302, USA Fax: 303.415.2597 E-Mail: [EMAIL PROTECTED]
[flexcoders] Re: Newbie: binding RadioButtonGroup to a boolean database column
No. I tried that too. Having a third radio button whose visible property is set to false, that looks for a value of 'null' or '' or whatever I choose the third value (besides 'Yes'or 'No', works fine but seems like unnecessary work. Has anyone solved this differently? I could use a single checkbox, but people are used to separate yes and no radio buttons, and they're also not going to see the difference between false and null in this case. Thanks, Jack --- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] wrote: On Thursday 23 November 2006 00:01, jack_freud wrote: labels of the two RadioButtons I have), then thought it would be even cleaner to have the DB stored proc translate the value from the bit field to 'Yes', 'No' or 'null' so the binding statement would be simple. Does '' work better than null ? -- Tom Chiverton Helping to seamlessly repurpose clicks-and-mortar systems 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.
RE: [flexcoders] GLOBAL functions?
Hi, Try creating a package with a class containing all your global functions (i.e myUtils), then you can include this package and use the class including functions and variables. Hope this helps, Flexy _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steve Kellogg @ Project SOC Sent: Saturday, November 25, 2006 7:05 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] GLOBAL functions? Hello, I've got some functions and variables in my main MXML file that I need to access from other MXMLs in the project. For some reason, I can't seem to figure out how to do this. I've (obviously) checked the documentation looking for a 'global' keyword, or for an 'extern' keyword or for some other way to do this. I'm sure I'm missing something obvious. Could someone point me in the right direction? Thanks in advance, Steve Steve Kellogg Peak8 Solutions 1401 14th Street Boulder, Colorado 80302, USA Fax: 303.415.2597 E-Mail: [EMAIL PROTECTED]
[flexcoders] Re: Newbie: binding RadioButtonGroup to a boolean database column
Hi Jack, One way would be to conditionally set the individual radio button's selected property. if (value == null) { yesRadioButton.selected=false; noRadioButton.selected=false; } -TH __ Tim Hoff Cynergy Systems, Inc. http://www.cynergysystems.com Office http://www.cynergysystems.comoffice/ : 866-CYNERGY --- In flexcoders@yahoogroups.com, jack_freud [EMAIL PROTECTED] wrote: No. I tried that too. Having a third radio button whose visible property is set to false, that looks for a value of 'null' or '' or whatever I choose the third value (besides 'Yes'or 'No', works fine but seems like unnecessary work. Has anyone solved this differently? I could use a single checkbox, but people are used to separate yes and no radio buttons, and they're also not going to see the difference between false and null in this case. Thanks, Jack --- In flexcoders@yahoogroups.com, Tom Chiverton tom.chiverton@ wrote: On Thursday 23 November 2006 00:01, jack_freud wrote: labels of the two RadioButtons I have), then thought it would be even cleaner to have the DB stored proc translate the value from the bit field to 'Yes', 'No' or 'null' so the binding statement would be simple. Does '' work better than null ? -- Tom Chiverton Helping to seamlessly repurpose clicks-and-mortar systems 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] best way to do database to Java to XML to flex
I have been using remoting to get data out of my database and into flex. The nice thing about this is it handles all the data conversion issues etc. But now, I have a need to be able to communicate certain data in XML format. I would imagine that there must be a clean process/format for communicating between server and client in XML such that the datatypes and reserved characters such as ,',,, are handled. what is the easiest way of doing this? Is there some XML database communications standard which flex can read? Do people just roll their own (ugh?). There must be a clean easy way to do this. Hank
[flexcoders] How to implement Lazy Hibernate?
Hi All, I'm attempting to create a Cairngorm/FDMS/Hibernate/MySQL example program which I'll publish to the community once completed. I used the MySQL Sakila sample DB (pared down to 3 tables - Film, Actor FilmActor - at present) and used HibernateTools to reverse engineer the requisite Java and Hibernate files. So far, so good. I've even managed to successfully write corresponding .as files and implement the beginnings of a Cairngorm front end. And it works. Kind of. The problem is that the persistence layer takes forever to load, even though the 3 tables only have hundreds or thousands of records each. I've temporarily pared them down considerably (to 100, 100 500 records) and the program now loads quickly enough that I can continue development work, but the performance issue needs to be addressed. It's fairly easy to see what the problem is. Here's a picture of the variable window that depicts the situation in all its glory: http://www.brightworks.com/technology/tech_questions/hibernate_lazy_associations/deeply_nested_actors_and_films.jpg Beautiful, isn't it?? :-) In other words, every actor references all films that the actor is in... And each of these films references all actors in the film... And each of these actors references all films that the actor is in... And each of these films references all actors in the film... Etc, etc, etc, etc, etc. I wonder how many levels deep this goes? The program doesn't hang so I assume that Flex puts a stop to it at some point... Anyway, I'm assuming that the solution is to implement lazy associations. My understanding is that Hibernate does lazy associations by default, so once I set up my destinations properly all will be well. But despite several attempts, I keep getting error messages. Could one of the Hibernate gurus that inhabits this list point me in the correct direction? The DB's schema is outlined here: http://www.brightworks.com/technology/tech_questions/hibernate_lazy_associations/index.html And all relevant code, plus my latest error message, is here: http://www.brightworks.com/technology/tech_questions/hibernate_lazy_associations/code.txt I assume that my problem is in data-management-config.xml, but I'm new to all of this and could be doing other things wrong as well. TIA! Douglas - Douglas McCarroll CairngormDocs.org Webmaster http://www.CairngormDocs.org Flex Developer http://www.brightworks.com 617.459.3840 -
RE: [flexcoders] How to implement Lazy Hibernate?
Lazy Loading probably isn't going to help you. You probably want to consider doing an intermediate class between any many-to-many associations in hibernate so you have two many-to-one associations instead. --Kelly _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Douglas McCarroll Sent: Saturday, November 25, 2006 3:32 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] How to implement Lazy Hibernate? Hi All, I'm attempting to create a Cairngorm/FDMS/Hibernate/MySQL example program which I'll publish to the community once completed. I used the MySQL Sakila sample DB (pared down to 3 tables - Film, Actor FilmActor - at present) and used HibernateTools to reverse engineer the requisite Java and Hibernate files. So far, so good. I've even managed to successfully write corresponding .as files and implement the beginnings of a Cairngorm front end. And it works. Kind of. The problem is that the persistence layer takes forever to load, even though the 3 tables only have hundreds or thousands of records each. I've temporarily pared them down considerably (to 100, 100 500 records) and the program now loads quickly enough that I can continue development work, but the performance issue needs to be addressed. It's fairly easy to see what the problem is. Here's a picture of the variable window that depicts the situation in all its glory: http://www.brightwo http://www.brightworks.com/technology/tech_questions/hibernate_lazy_associa tions/deeply_nested_actors_and_films.jpg rks.com/technology/tech_questions/hibernate_lazy_associations/deeply_nested_ actors_and_films.jpg Beautiful, isn't it?? :-) In other words, every actor references all films that the actor is in... And each of these films references all actors in the film... And each of these actors references all films that the actor is in... And each of these films references all actors in the film... Etc, etc, etc, etc, etc. I wonder how many levels deep this goes? The program doesn't hang so I assume that Flex puts a stop to it at some point... Anyway, I'm assuming that the solution is to implement lazy associations. My understanding is that Hibernate does lazy associations by default, so once I set up my destinations properly all will be well. But despite several attempts, I keep getting error messages. Could one of the Hibernate gurus that inhabits this list point me in the correct direction? The DB's schema is outlined here: http://www.brightwo http://www.brightworks.com/technology/tech_questions/hibernate_lazy_associa tions/index.html rks.com/technology/tech_questions/hibernate_lazy_associations/index.html And all relevant code, plus my latest error message, is here: http://www.brightwo http://www.brightworks.com/technology/tech_questions/hibernate_lazy_associa tions/code.txt rks.com/technology/tech_questions/hibernate_lazy_associations/code.txt I assume that my problem is in data-management-config.xml, but I'm new to all of this and could be doing other things wrong as well. TIA! Douglas - Douglas McCarroll CairngormDocs.org Webmaster http://www.Cairngor http://www.CairngormDocs.org mDocs.org Flex Developer http://www.brightwo http://www.brightworks.com rks.com 617.459.3840 -
[flexcoders] Re: Initial order column for DataGrid - Flex2
You should try to sort the ArrayCollection that is bound to the dataGrid's dataProvider. Once the collection or the source array is sorted, your data grid will be sorted. Kim --- In flexcoders@yahoogroups.com, kehlpeter [EMAIL PROTECTED] wrote: Hi, is there any way to set a default/initial order column for a DataGrid in Flex2? None of the following compiles in Flex 2: grid.sortItemsBy( 'columnName', 'asc'); grid.sortIndex= 1; grid.sortDirection= 'ASC'; grid.placeSortArrow(); I can't see any method/property to do this directly. I know how to create a DataGridEvent with type being DataGridEvent.HEADER_RELEASE, but don't know how to 'trigger' or dispatch it. I've tried dispatchEvent( event ) in both application.creationComplete and grid.initialize. Thank you for any ideas.
[flexcoders] head namespace in Flex 2 Style Explorer
Hi guys, I've been looking into the Flex 2 Style Explorer at http://examples.adobe.com/flex2/consulting/styleexplorer/Flex2StyleExplorer.html and have a question about the head namespace used in the example. Could someone point out where in the code that namespace is being declared? For example, there is a reference to head:GlassHeaders all over the place, but I cannot understand how head is resolved. Does it have a special meaning? What am I missing here? Thanks, Mark
[flexcoders] DataBinding Vs. Procedural Model Updates
Hi All, Anyone know the performance implications of using databinding to update a model vs an 'updateModel()' type call? I can use basic databinding to bind a form to the model (source={foo.customer_name}) and databinding calls to bind foo.customer_name back to the form control (so your model is updated everytime a form field is updated). This has the advantage that your model is always up to date with respect to the form - no extra processing required. I could also just use the basic databinding to bind the form controls to the model, and an UpdateModel(m:Model) call to grab the contents of all the fields and shove them back into the model. This requires an extra function call to 'sync' the model with the form, but skips all the event handling (for instance, if you update the 'customer_name' control 3 times, you only update the model once at the end) Anyone know how much of a load data binding/event processing puts on the system with a moderately complicated app? I'm figuring 10-20 tables of 20-40 fields each. This is for a data entry app, so users will be in all parts of the app all day long. Should I be looking at un-binding models when they are not used/active (ie, if you switch from clients to vendors, should I unbind the fields on the 'clients' model ?) steve
Re: [flexcoders] SWFLoader - local parent SWF / remote child SWF
without apollo, I don't think so On 11/24/06, keithtucci [EMAIL PROTECTED] wrote: i have a local SWF file (to be more exact a projector executable, built w/ zinc) that needs to use SWFLOADER to run a remote swf file. i get sandbox security errors when i attempt to do this... is this even possible...? thanks in advance...
[flexcoders] padding in the text in cells in a datagrid
Hi , How to give padding to text in the cells. In my datagrid I have numbers which are right aligned, but they are too much right aligned, the text in last column touches the scroll bar. Can I have padding in the text?
[flexcoders] drawing a stack of rectangle ?
Hi, I am drawing a stack which contans rectangles of different depending on some value. rectangles are drawn but they are overlapping each other by 1 or 2 pixels at the end. I have to highlight the rectangles also, for that I am creating a rectangle on mouseOver event and adding the rectangle on the same rectangle that I am highlighting, but this way the lower border of the highlighter gets covered by the rectangle below that.