[flexcoders] Equivalent to html embed tag's scale attribute?
Is there any way to achieve what the scale=noBorder attribute in the html embed tag does? I need to have a flash movie take up the whole area of an mx:Image tag without being shrunk or distorted. The scale=noBorder usually does this in HTML, or Stage.scaleMode = noBorder in straight-up Flash, but I can't seem to get this to happen in Flex... Help! Thanks - Josh -- 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] Help with loading of some SWF content in an mx:Image tag
I have a banner that I load into my Image tag, and this banner goes out to the server it came from to request a TXT file to load up some variables. The problem is that I want to be able to use as much client side as possible. Is there a way to override it loading these vars so I can put in my own by passing the Image object the names of the vars I need to load? For example: mx:Image source=test.swf id=test/ Then going: test[_level5].someVar = foo; I have tested this with other simpler SWFs and it appears that I CAN in fact set internal fields as long as I know their name. The problem with this particular flash movie is that I believe I set the fields, but then it overwrites them with values it gets in the TXT file. Right now, I have no choice but to serve it a TXT file, because if I don't regardless of what the values are set to, it wont play until it loads this file. I don't have the source to this file, but I do know where the vars need to be set. Help is much appreciated! Thanks... -Josh -- 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] Dynamically add an MXML to a Panel
I have a Panel in my application that needs to include different form stuff based on what a user chooses in a ComboBox. I have a Panel that looks like: mx:Panel title=Message Specifics width=100% height=100% id=editMessageSpecificsPanel/ Based on the selection they choose in the ComboBox, I need what shows up in the Panel to change. I have created several MXML files that have an HBox that lays out what the Panel's internals need to look like. One very simple one looks like: mx:HBox width=100% xmlns:mx=http://www.macromedia.com/2003/mxml; mx:Form width=100% marginTop=5 marginBottom=0 mx:FormItem label=Text mx:TextArea id=messageText text= width=250 height=80 enabled=false editable=true / /mx:FormItem /mx:Form /mx:HBox I call, upon the change event on the ComboBox. It contains a bunch of objects, with the property resource containing the name of the MXML file I need to include: private function loadMessageSpecificsPanel(event) { var resource = event.target.selectedItem.data.resource; // Get the name of the MXML file we need var child = editMessageSpecificsPanel.createChild(resource, undefined, {label:'TEST', width:'100%', height:'100%'}); } This isn't working though. Even though child IS getting populated with something, it's not correct, doesn't have any of the variables I specified in the included MXML, and the Panel in the UI is still blank. Any help is MUCH appreciated! -Josh Oransky -- 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] Re: Trouble getting mx:List to show any changes to dataProvider
WEIRD! I found the problem, but I'm not sure it makes me feel any better. After adding a labelFunction, and seeing that it wasn't even being called, I decided to add some funky methods to my Node class and debug them, just to see what was happening there. To my surprise, when I clicked files in debug, I noticed that the Node class was not there. Apparently, though the array group.nodes was populated with Node objects, and they had all the correct data that existed in the remote database, they weren't being instantiated; or, at least, they weren't as Node objects. What I did, was a simple var node:Node = new Node(); in my main MXML file. This empty class does nothing except register that there is a Node class that can be instantiated. After that, my problem is solved. The List shows all the Nodes correctly, and Node appears in the list of debuggable classes. This isn't, however, a fix. WHY does Flex instantiate all my remote objects except Node? I properly state the Object.registerClass, and upon debugging the code, it SAYS that the group.nodes is an Array of Nodes. My remote POJO doesn't deviate from standard Java bean structure. There's nothing special about my Node class, especially when compared to my other POJOs which work fine. It doesn't reference any weird classes, and certainly none that my other operating POJOs don't also reference and operate on. This is a strange, and seemingly unexplainable problem. Any insight would be helpful. Especially if it's something *I* did! -Josh --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: If your dataProvider has data then look again at your labelField settings or labelFunction code. In a labelFunction, be sure to use the dataProvider API methods, not array or xml methods. Use a trace in the labelFunction, or step through it in the debugger, you should be able to see what is happening. What does your array contain? Indexed Arrays or Objects? Post a sample of the data and the labelFunction. Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of cazzaran Sent: Wednesday, June 08, 2005 6:32 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Trouble getting mx:List to show any changes to dataProvider For some reason, I have one mx:List in mxml that refuses to show the contents of its dataProvider. I have: mx:List height=100% width=100% id=theRDUList vScrollPolicy=auto dragEnabled=false change= selectable=true hScrollPolicy=auto/ And my code to change it is: theRDUList.dataProvider = group.nodes; The thing is, upon debug, I can see that group.nodes is full of an Array, *AND* the dataProvider property of theRDUList is ALSO full of the same data. So the dataProvider is getting set, but the list absolutely refuses to show anything, despite my attempts. I've tried multiple labelField settings, labelFunc settings, adding implicit gets to my Node object (in the Array) so that nothing should be required on the MXML tag... nothing. And all my other lists work fine. Anyone know of something I'm missing? This seems straight forward... Weird... -Josh Yahoo! Groups Links 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] Re: Trouble getting mx:List to show any changes to dataProvider
I'd rather not use a labelFunction, instead just using a labelField would be fine. So I tried adding a different array of objects, and it works. So it has something to do with either the array of objects I want to pass, or the objects inside of that array. The array consists of Node objects, which are AS versions of some remote POJOs that I get a set of. They don't contain much; just an id field and some relational information. Here's the entire AS class: import pojos.*; class pojos.Node { public static var regClass = Object.registerClass(pojos.Node, pojos.Node); public var id:String, name:String, groupID:String; public var nodeType:NodeType; public var group:Group; public var organization:Organization; public function Node() {} public function get data() { return this; } public function get label() { return id; } } Thanks! -Josh --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: If your dataProvider has data then look again at your labelField settings or labelFunction code. In a labelFunction, be sure to use the dataProvider API methods, not array or xml methods. Use a trace in the labelFunction, or step through it in the debugger, you should be able to see what is happening. What does your array contain? Indexed Arrays or Objects? Post a sample of the data and the labelFunction. Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod [EMAIL PROTECTED] On Behalf Of cazzaran Sent: Wednesday, June 08, 2005 6:32 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Trouble getting mx:List to show any changes to dataProvider For some reason, I have one mx:List in mxml that refuses to show the contents of its dataProvider. I have: mx:List height=100% width=100% id=theRDUList vScrollPolicy=auto dragEnabled=false change= selectable=true hScrollPolicy=auto/ And my code to change it is: theRDUList.dataProvider = group.nodes; The thing is, upon debug, I can see that group.nodes is full of an Array, *AND* the dataProvider property of theRDUList is ALSO full of the same data. So the dataProvider is getting set, but the list absolutely refuses to show anything, despite my attempts. I've tried multiple labelField settings, labelFunc settings, adding implicit gets to my Node object (in the Array) so that nothing should be required on the MXML tag... nothing. And all my other lists work fine. Anyone know of something I'm missing? This seems straight forward... Weird... -Josh Yahoo! Groups Links 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] Trouble with mx:Image or mx:Loader
I have a flash banner that displays its content in the vertical middle. I have an application that is 800px wide, but the banner is, by default, only around 600px wide. My tag looks like: mx:Image contentPath=autumn.swf scaleX=100 scaleContent=true width=800 / If I specify the width attribute of the Image tag, the flash movie doesn't scale with it. Usually, the way I get this banner to work in html is to pass a scale=noborder attribute to the embed tag and it takes up as wide as the container (div for example) that the embed is contained in. How to I do this in Flex? Also, I need the vertical middle of the movie to show, not the top section that I specify. I tried using hPosition, but to no avail. Any help is appreciated! -Josh 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] Pass variable to mx:image tag
I need to include an external SWF file that takes variables to display some content. It's just a banner, so the mx:Image tag is sufficient, except that I can't figure out how to pass variable information to it. There's talk of a flashVar tag, but that's for JSP, and it doesn't look like there's an equivilant mxml tag. My include is basic, and looks like mx:Image source=banner.swf / Any help is appreciated! -Josh 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] Re: Pass variable to mx:image tag
Matt, Thanks for the response. A related question: is there a limit on the size of the query string? I know for browsers it's 255 chars. Otherwise, is there a way to load the values as FlashVars? -Josh --- In flexcoders@yahoogroups.com, Matt Horn [EMAIL PROTECTED] wrote: You can append query string params to pass variable data to an included SWF. psuedoexample: var src = IncludedTestFile.swf?myVar= + myVar; ... mx:Image source={src} / HTH, matt horn flex docs From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of cazzaran Sent: Thursday, May 12, 2005 11:51 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Pass variable to mx:image tag I need to include an external SWF file that takes variables to display some content. It's just a banner, so the mx:Image tag is sufficient, except that I can't figure out how to pass variable information to it. There's talk of a flashVar tag, but that's for JSP, and it doesn't look like there's an equivilant mxml tag. My include is basic, and looks like mx:Image source=banner.swf / Any help is appreciated! -Josh 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] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . 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] Re: Error: Cannot invoke method when using a VO
Christoph, Actually, I haven't solved it yet. It trying different things, which mostly amount to working *around* the problem (like reducing my object graph depth, etc). I agree, I like using deep object graphs to, but can't seem to get it to work. -Josh --- In flexcoders@yahoogroups.com, Christoph Guse [EMAIL PROTECTED] wrote: Hi cazzaran, how did you solve your problem? I'm interested in a solution, because I have a very similar problem. In my case I have an object (OgoJobVO) in which is another object (OgoAccountVO) in which is another object (OgoPersonVO). When I get the Job-Object from the Server, everything works fine. When I try to call a function in a POJO where a Job-Object as an argument, I get the following error in the NetConnectionDebugger: Status (object #2) .code: Server.Processing .description: Cannot invoke method 'insertJob'. .details: The expected argument types are (ogo.OgoJobVO, java.lang.String, java.lang.String) but the supplied types were (flashgateway.io.ASObject, java.lang.String, java.lang.String) and converted to (null, null, null). .level: error .type: .rootcause (object #3) ..code: (undefined) ..description: Type ogo.vo.OgoJobVO not found ..details: ..level: error ..type: The call looks like this: var call = service.insertJob(jobarg,login,password); I tested the argument jobarg with if(jobarg instanceof OgoJobVO){ text=type of OgoJobVO; } else{ text=is not type of OgoJobVO; } mx.core.Application.application.debugtext = text; This returns type of OgoJobVO. I really would like to use nested Objects. I appreciate for any suggestions. Christoph cazzaran wrote: Found it... but it doesn't make total sense... here's the response trace: Info: Serializing response (Message #0 targetURI=/1/onStatus, responseURI=null) (Object #0) level = error code = Server.Processing type = rootcause = (Object #1) level = error code = null type = details = description = Could not set object null on class pojos.Group's method setOrganization details = The expected argument types are (pojos.Group) but the supplied types were (flashgateway.io.ASObject) and converted to (null). description = Cannot invoke method 'addGroup'. Below's the serialized request. You can see that the organization IS being serialized... I'm not sure why it thinks that the expected argument types are Group. The addGroup requires a Group, but the Group.setOrganization method takes an Organization. They all have _remoteClass assigned, too. Weird... Info: Deserializing request (Message #0 targetURI=groupDelegate.addGroup, responseURI=/1) (Array #0) [0] = (Object #1) _flag = Envelope headers = (Array #2) [0] = (Array #3) [0] = ServiceType [1] = false [2] = stateful-class data = (Array #4) [0] = (Typed Object #5 'pojos.Group') organization = (Typed Object #6 'pojos.Organization') _remoteClass = pojos.Organization contactNumber = null address1 = null roles = (Array #7) [0] = (Typed Object #8 'pojos.Role') roleRights = a, d, m users = (Array #9) _remoteClass = pojos.Role userRights = d groupRights = a, d, m name = Local Message Creator id = 402881e500523eca0100523ffc040001 organization = (Ref #6) superuser = false [1] = (Typed Object #10 'pojos.Role') roleRights = adm users = (Array #11) [0] = (Typed Object #12 'pojos.User') password = passger organizationId = null _remoteClass = pojos.User username = cazzaran email = [EMAIL PROTECTED] role = (Ref #10) roleID = 1 firstName = Josh id = 1 organization = (Ref #6) the rest truncated *Yahoo! Groups Sponsor* ADVERTISEMENT click here http://us.ard.yahoo.com/SIG=1290ag9o1/M=298184.6018725.7038619.3001176/D=groups/S=1705007207:HM/EXP=1112321921/A=2593423/R=0/SIG=11el9gslf/*http://www.netflix.com/Default?mqso=60190075 *Yahoo! Groups Links* * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders
[flexcoders] Prevent dynamic properties from being set
I have some POJOs on my server like Role, etc... They have many getter methods that return subsets of actual data. For example, Role has getGroups() and getSubGroups(), where getSubGroups() returns a filtered list of what getGroups() would (they both reference the same Set in the object, but just loop over it differently). My problem is that when an object gets created on my client side, two variables are created, groups, and subGroups, even though I didn't specify a variable called subGroups (I DID specify a groups, though). When I send this object back over the wire, I get a lot of redundant stuff sent because it's serializing both groups and subGroups. What I want is for the serializer to respect the variables I set in my object, and not to create ones that aren't there. I know that an object can be set dynamic to allow what I'm seeing, but I haven't set this on any of my objects, and I'm seeing dynamic properties being set anyway. Any help is appreciated! -Josh 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] Re: Popup only works once
That didn't seem to change my problem. My popup still refuses to come back once it's been closed once. this.deletePopUp() (or using the doLater) is the right place to be doing this, right? -Josh --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: Just for fun, try the magic doLater(). doLater(this, deletePopUp) Tracy -Original Message- From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Thursday, April 07, 2005 6:00 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Popup only works once I have an Add Group button in my MXML that calls a method: public function showAddGroupWindow():Void { var popup = PopUpManager.createPopUp(MovieClip(mx.core.Application.application), addGroupWindow, true); popup.centerPopUp(); } In my popup MXML, which is just a simple title window, I have a save and a cancel button. My cancel button calls the method: function cancelButtonPressed() { this.deletePopUp(); } The save button is having the same problem... If I click either button, the popup closes, but the Add Group button wont open another popup. I've verified that it's still calling the showAddGroupWindow() method, but for some reason, nothing pops up anymore. I have a feeling the deletePopUp() isn't fully getting rid of it... where am I going wrong? Yahoo! Groups Links 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] Popup only works once
I have an Add Group button in my MXML that calls a method: public function showAddGroupWindow():Void { var popup = PopUpManager.createPopUp(MovieClip(mx.core.Application.application), addGroupWindow, true); popup.centerPopUp(); } In my popup MXML, which is just a simple title window, I have a save and a cancel button. My cancel button calls the method: function cancelButtonPressed() { this.deletePopUp(); } The save button is having the same problem... If I click either button, the popup closes, but the Add Group button wont open another popup. I've verified that it's still calling the showAddGroupWindow() method, but for some reason, nothing pops up anymore. I have a feeling the deletePopUp() isn't fully getting rid of it... where am I going wrong? 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] Re: Simple Cairngorm architecture question
If you looks at the mx.controls.Alert class, you can only give the show() method a listener object, and that object must implement a click() method. You can't specify which method the Alert may call, so I'm stuck giving it an object that has one click(). If this object happens to be the MXML, then I can't use it for different Alerts, because each one will only call click(). So now I have to decide where the proper place for click() should be. I don't want to use groupdetails.mxml, for the reason stated above (I also have buttons that deactivate groups, and do other things, all backed by Alerts). I don't know if it should go into the DeleteGroupCommand. I supposed I could add a click() method to this command, that kicks off an event that runs the same command, but that seems messy. It also somewhat ties my command to my view, since the Alert is just a UI technicality. This leaves the GroupDetailsViewHelper, but again, using this class for broadcasting a command event might not be right. Thoughts? -Josh --- In flexcoders@yahoogroups.com, Omar Ramos [EMAIL PROTECTED] wrote: Why do you have to only have one click method? You can use the Delegate class to redirect each event to a difrent method. Omar Ramos Itacon Corporation Technology Manager _ From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 05, 2005 4:34 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Simple Cairngorm architecture question You're right. My question, is where should I put the click() that kicks off the event. I COULD put it in the MXML, and just have the view capture the click from the Alert and then broadcast the event, but a problem occurs once I have more than one button that needs to have an Alert attached; I can only have one click(). So now I need to find a place to put a click() for each Alert box... is the right place inside the Command class for each button's function? -Josh --- In flexcoders@yahoogroups.com, Jeff Krueger [EMAIL PROTECTED] wrote: Maybe I don't fully understand the question. But it seems that you would broadcast the DeleteGroup event only once the click of ok was pressed. The broadcast will find the command to do the work and then notify the view helper when done. Jeff -Original Message- From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 05, 2005 2:13 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Simple Cairngorm architecture question I have a simple architectural philosophy question regarding Cairngorm. I am using the Contoller, Command, and ViewHelper pattern, which is working out perfectly -- except in one situation... And it's not that I can't get this to work, it's that I'm curious what the proper way to do it would be. I have a delete button that allows my users to delete a Group out of a list. The issue is that I need to provide an Alert box with a OK/Cancel buttons. This alert box needs to be given a listener object with a click() method. My question is where does this belong? In the MXML that shows the Delete button, the DeleteGroupCommand, the ViewHelper associated with the view, or somewhere else entirely? This is a kind of hiccup in the whole Controller to Command flow... Yahoo! Groups Links _ 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] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . 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] Re: Simple Cairngorm architecture question
Omar, That really does help, I appreciate it. I was trying to figure out how to accomplish this... Again, thanks! -Josh --- In flexcoders@yahoogroups.com, Omar Ramos [EMAIL PROTECTED] wrote: Hi Josh, Here is a example of how you would do it. var alertListener:Function = Delegate.create(this,OnAlert_Click); Alert.show(This is a test of errors, Error, Alert.OK | Alert.CANCEL, this, alertListener); function OnAlert_Click() { trace(CLICK); } or you could also do this. Alert.show(This is a test of errors, Error, Alert.OK | Alert.CANCEL, this, Delegate.create(this,OnAlert_Click)); hope it helps. Omar Ramos Itacon Corporation Technology Manager 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] Re: Flex 1.5 price
it gives us a better understanding of how the product is being used, the sorts of problems people are facing, and so on, by interacting with real users rather than 'customers'. ... and participating in this forum is not necessarily a part of our job. And we love you for it! ;-) -Josh 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] How to get access to HttpSession in a stateful-class
I have some remote business delegates that are stateful. Is there a way to get access to the session that they are being held in? For example, I have a UserDelegate that handles user based business logic for the current logged in user, and it maintains a member variable of the user so I don't need to keep passing User stuff over the network. I also have a GroupDelegate, that obviously handles Group stuff. I need to be able to access the User variable in the UserDelegate so I can figure out some information about the user before I perform the Group operations (i.e. authorization, etc). My problem is that my Delegates are just POJOs, and so have no knowledge of requests, or sessions. Is there a way to get to the session that the stateful-class is being held in, or get at the request that is associated with that session? I know I could pass User information over the wire to my GroupDelegate, but this is inefficient, since the data's right there in memory on the server. Any help is appreciated! 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] Re: Error: Cannot invoke method when using a VO
WHat's interesting, is if you look at the below code, I have an array of Groups, called subGroups. This is populated with objects of the type Group, so that would seem to mean that Flex is typing them correctly, at least when they come FROM the server if I create a new object of this type and send it TO my server, it seems to not be correct. What's also weird, is if I inspect an object using debug, all the Groups in the subGroups array have _remoteClass set, even though I didn't specify it. This is due to the Object.registerClass I assume, but when I instantiate a new Group(), that object lacks this variable. It seems like it's being typed wrong from the client side. Am I interpreting this correctly? Here's what my Group.as code looks like: class pojos.Group { public static var regClass = Object.registerClass(pojos.Group, pojos.Group); public var id:String; public var name:String; public var organization:Organization; public var superGroup:Group; public var subGroups:Array; function Group() {} public function get data() { return id; } //... some getters and business methods } --- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote: Have you posted the Object.registerClass line of code in this thread yet? I've not yet seen it, but it must not be registered correctly or the class not linked in at compile time to match the registration as the player would send an instance of Group. All objects go over the wire as ASObjects, but they may include type information if they're registered. The raw representation of an ASObject on the server side is a HashMap. It's the server side part of RemoteObject that knows how to map ASObject - Group before invoking your method. Since you're not having any luck with Flex Builder, did you try what I suggested using the NetConnectionDebugger.swf (which ships in the extras folder of the Flex 1.5 install) with remote-objects debug enabled (it doesn't have anything to do with Flex Builder)? If that's not suitable then you could use the gateway debug level logging approach on the server. I'd prefer you to try the server gateway logging approach anyway as we want to see whether an AMF Typed Object or untyped Object was deserialized from your Group param. -Original Message- From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 30, 2005 2:12 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Error: Cannot invoke method when using a VO I turned on remote object debugging, but it seems to make my flexbuilder unresponsive. After a while, builder says that I should abort the script or it will make my machine lock up. If I set remote object debug to false and restart the server, this no longer happens. But I think I found the issue anyway; it seems that for some reason, the Group isn't being sent over the wire as a Group, even though I have the Object.registerClass correct. Also, when I get an array of Groups from my server, they are correct. But it seems that in my client class, when I do: var group:Group = new Group(); group.name = test; remoteDelegate.addGroup(group); it gives me that can't invoke method error, because it's not a Group POJO, it's just a hashmap. Why is this happening? --- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote: Have you managed to turn on debugging for remote-object in /WEB-INF/flex/flex-config.xml and looked at the trace of the AMF error in the NetConnection Debugger? There may be more information on the fault object in the rootcause property. If you have access to the server locally, you can also try turning on Debug level logging for the AMF Gateway in /WEB-INF/flex/gateway-config.xml and checking your Flex logs (or possibly just watching the console output if you manually launch JRun and have console logging enabled for Flex). This will show you what data type was being deserialized for your input parameter and it will also let you see the raw response going back with information similar to that shown in the NetConnection Debugger (though the server side is more accurate as the NCD is an old Flash Remoting tool that has a few issues - mainly that it doesn't show objects typed with Object.registerClass). -Original Message- From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 4:58 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Error: Cannot invoke method when using a VO Peter, Here's my whitelist: whitelist unnamed source*/source /unnamed named object name=userDelegate sourcebusinessdelegates.UserDelegate/source typestateful-class/type allow-unnamed-accessfalse/allow-unnamed-access /object object name=groupDelegate
[flexcoders] Re: Error: Cannot invoke method when using a VO
I turned on remote object debugging, but it seems to make my flexbuilder unresponsive. After a while, builder says that I should abort the script or it will make my machine lock up. If I set remote object debug to false and restart the server, this no longer happens. But I think I found the issue anyway; it seems that for some reason, the Group isn't being sent over the wire as a Group, even though I have the Object.registerClass correct. Also, when I get an array of Groups from my server, they are correct. But it seems that in my client class, when I do: var group:Group = new Group(); group.name = test; remoteDelegate.addGroup(group); it gives me that can't invoke method error, because it's not a Group POJO, it's just a hashmap. Why is this happening? --- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote: Have you managed to turn on debugging for remote-object in /WEB-INF/flex/flex-config.xml and looked at the trace of the AMF error in the NetConnection Debugger? There may be more information on the fault object in the rootcause property. If you have access to the server locally, you can also try turning on Debug level logging for the AMF Gateway in /WEB-INF/flex/gateway-config.xml and checking your Flex logs (or possibly just watching the console output if you manually launch JRun and have console logging enabled for Flex). This will show you what data type was being deserialized for your input parameter and it will also let you see the raw response going back with information similar to that shown in the NetConnection Debugger (though the server side is more accurate as the NCD is an old Flash Remoting tool that has a few issues - mainly that it doesn't show objects typed with Object.registerClass). -Original Message- From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 4:58 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Error: Cannot invoke method when using a VO Peter, Here's my whitelist: whitelist unnamed source*/source /unnamed named object name=userDelegate sourcebusinessdelegates.UserDelegate/source typestateful-class/type allow-unnamed-accessfalse/allow-unnamed-access /object object name=groupDelegate sourcebusinessdelegates.GroupDelegate/source typestateful-class/type allow-unnamed-accessfalse/allow-unnamed-access /object /named /whitelist -Josh --- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote: Ah, what does the unnamed whitelist in the remote-object section look like? Does it include your Group class? I apologize for not double checking whether it was still a requirement in Flex 1.5, but I know it was in Flex 1.0. -Original Message- From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 4:19 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Error: Cannot invoke method when using a VO Peter, It does... -Josh --- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote: Does the Java version of Group have a public no args constructor? -Original Message- From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 3:50 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Error: Cannot invoke method when using a VO I have a delegate class on my server called GroupDelegate, and it has a method addGroup(Group group). When I try and call this method on my remote object, I get the error: Error: Cannot invoke method addGroup However, if I switch my method's signature to addGroup(String groupName), the method executes, and the group is added to the DB. Group is just a POJO, and obviously the second method wont work because there is a lot more information than just the groupName that needs to be recorded... Interestingly, when I do a getGroups I get back an array of the correct objects, and in my client side model of my Group class I have correctly done the Object.registerClass. The only time I seem to have an issue is when I pass it BACK to my server as a Group. Any ideas? -Josh Yahoo! Groups Links Yahoo! Groups Links Yahoo! Groups Links 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] Re: Error: Cannot invoke method when using a VO
Found it... but it doesn't make total sense... here's the response trace: Info: Serializing response (Message #0 targetURI=/1/onStatus, responseURI=null) (Object #0) level = error code = Server.Processing type = rootcause = (Object #1) level = error code = null type = details = description = Could not set object null on class pojos.Group's method setOrganization details = The expected argument types are (pojos.Group) but the supplied types were (flashgateway.io.ASObject) and converted to (null). description = Cannot invoke method 'addGroup'. Below's the serialized request. You can see that the organization IS being serialized... I'm not sure why it thinks that the expected argument types are Group. The addGroup requires a Group, but the Group.setOrganization method takes an Organization. They all have _remoteClass assigned, too. Weird... Info: Deserializing request (Message #0 targetURI=groupDelegate.addGroup, responseURI=/1) (Array #0) [0] = (Object #1) _flag = Envelope headers = (Array #2) [0] = (Array #3) [0] = ServiceType [1] = false [2] = stateful-class data = (Array #4) [0] = (Typed Object #5 'pojos.Group') organization = (Typed Object #6 'pojos.Organization') _remoteClass = pojos.Organization contactNumber = null address1 = null roles = (Array #7) [0] = (Typed Object #8 'pojos.Role') roleRights = a, d, m users = (Array #9) _remoteClass = pojos.Role userRights = d groupRights = a, d, m name = Local Message Creator id = 402881e500523eca0100523ffc040001 organization = (Ref #6) superuser = false [1] = (Typed Object #10 'pojos.Role') roleRights = adm users = (Array #11) [0] = (Typed Object #12 'pojos.User') password = passger organizationId = null _remoteClass = pojos.User username = cazzaran email = [EMAIL PROTECTED] role = (Ref #10) roleID = 1 firstName = Josh id = 1 organization = (Ref #6) the rest truncated 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] Error: Cannot invoke method when using a VO
I have a delegate class on my server called GroupDelegate, and it has a method addGroup(Group group). When I try and call this method on my remote object, I get the error: Error: Cannot invoke method addGroup However, if I switch my method's signature to addGroup(String groupName), the method executes, and the group is added to the DB. Group is just a POJO, and obviously the second method wont work because there is a lot more information than just the groupName that needs to be recorded... Interestingly, when I do a getGroups I get back an array of the correct objects, and in my client side model of my Group class I have correctly done the Object.registerClass. The only time I seem to have an issue is when I pass it BACK to my server as a Group. Any ideas? -Josh 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] Re: Error: Cannot invoke method when using a VO
Peter, It does... -Josh --- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote: Does the Java version of Group have a public no args constructor? -Original Message- From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 3:50 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Error: Cannot invoke method when using a VO I have a delegate class on my server called GroupDelegate, and it has a method addGroup(Group group). When I try and call this method on my remote object, I get the error: Error: Cannot invoke method addGroup However, if I switch my method's signature to addGroup(String groupName), the method executes, and the group is added to the DB. Group is just a POJO, and obviously the second method wont work because there is a lot more information than just the groupName that needs to be recorded... Interestingly, when I do a getGroups I get back an array of the correct objects, and in my client side model of my Group class I have correctly done the Object.registerClass. The only time I seem to have an issue is when I pass it BACK to my server as a Group. Any ideas? -Josh Yahoo! Groups Links 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] Can't see selectedNode on my Tree change event
I have a Tree that has a method bound to the change event. Problem is, for some reason, the event.target doesn't have a selectedNode property, so I can't seem to find out what Node the user clicked. As I understand it, this property should be there. Am I correct? Any ideas? Thanks in advance... 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] Re: Can't see selectedNode on my Tree change event
Well, I can't see it when debugging, but it's accessable, so nevermind... thanks... --- In flexcoders@yahoogroups.com, cazzaran [EMAIL PROTECTED] wrote: I have a Tree that has a method bound to the change event. Problem is, for some reason, the event.target doesn't have a selectedNode property, so I can't seem to find out what Node the user clicked. As I understand it, this property should be there. Am I correct? Any ideas? Thanks in advance... 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] Weird tree issue
I have a tree I'm populating with objects that mimic my serverside Group classes. What's happening is that the tree is getting built, but the data field of the nodes isn't getting filled. This method: var node = treeDP.addTreeNode(group.name, group); is supposed to create a node with the label of the group's name, and the group object itself as the data. Problem is, while the tree gets populated, and you can see the nodes with labels, the actual group isn't there in the data field. Obviously the group is getting instantiated, because the tree nodes have labels... Any reason why this shouldn't work? I'm new to Flex, and AS, but this seems like it should work. Below is the code I use to fill my tree... var treeDP; public function initGroupTree() { user = mx.core.Application.application.user; var topGroups:Array = user.organization.onlyTopSuperGroups; treeDP = new TreeNode(); for(var i in topGroups) { var group:Group = topGroups[i]; var node = treeDP.addTreeNode(group.name, group); addSubGroupsToTree(node, group); } groupTree.dataProvider = treeDP; } private function addSubGroupsToTree(node, group:Group):Void { var subGroups:Array = group.subGroups; for(var i in subGroups) { var group:Group = subGroups[i]; var subNode = node.addTreeNode(group.name, group); addSubGroupsToTree(subNode, group); } } 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] Re: Problem with variable initialization
Matt: Will the dataproviders of List controls use the getter? I thought they only looked at the member data... -Josh --- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote: When the constructor is called none of the variables have been assigned yet. How about instead of the variable data you use a getter: Public function get data() : String { Return id; } Matt _ From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Saturday, March 26, 2005 6:14 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Problem with variable initialization I have a weird (to me, anyway) problem. I have some AS 2 objects that are client models of my Hibernate POJOs on my server. I want to get all my data set to the members of my class, but then have another variable, data, set to the same value as my id variable. This is so when I get an array of my objects, I can use it directly as a dataprovider to a list or something like that. Since my server class doesn't have a variable named data, but it does have one named id that I want to use as my data, I did this below: class pojos.Role { public var _remoteClass:String; public var id:String, name:String, roleRights:String, userRights:String, groupRights:String; public var superuser:Boolean; public var organization:Organization; public var users:Array; public var data:String; public function Role() { _remoteClass = pojos.Role; data = id; // for showing in list components } } My problem is that data is undefined when I try an access it, but id isnt. So the data is definately coming from my server, but data isn't being set to id when id gets set. What am I doing wrong? HELP! Thanks in advance... Yahoo! Groups Sponsor ADVERTISEMENT http://us.ard.yahoo.com/SIG=1298lpq25/M=298184.6191685.7192823.3001176/D=gr oups/S=1705007207:HM/EXP=976062/A=2593423/R=0/SIG=11el9gslf/*http:/www.n etflix.com/Default?mqso=60190075 click here http://us.adserver.yahoo.com/l?M=298184.6191685.7192823.3001176/D=groups/S= :HM/A=2593423/rand=858236756 _ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! http://docs.yahoo.com/info/terms/ Terms of Service. 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] Re: Problem with variable initialization
Matt, That worked! Thanks man, you saved me a lot of headache... -Josh --- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote: It will use a getter if it knows to request the property. So if you specify a labelField or if you're using DataGrid and you create a column with the columnName of the getter it'll be fine. Matt _ From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Saturday, March 26, 2005 7:16 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Problem with variable initialization Matt: Will the dataproviders of List controls use the getter? I thought they only looked at the member data... -Josh --- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote: When the constructor is called none of the variables have been assigned yet. How about instead of the variable data you use a getter: Public function get data() : String { Return id; } Matt _ From: cazzaran [mailto:[EMAIL PROTECTED] Sent: Saturday, March 26, 2005 6:14 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Problem with variable initialization I have a weird (to me, anyway) problem. I have some AS 2 objects that are client models of my Hibernate POJOs on my server. I want to get all my data set to the members of my class, but then have another variable, data, set to the same value as my id variable. This is so when I get an array of my objects, I can use it directly as a dataprovider to a list or something like that. Since my server class doesn't have a variable named data, but it does have one named id that I want to use as my data, I did this below: class pojos.Role { public var _remoteClass:String; public var id:String, name:String, roleRights:String, userRights:String, groupRights:String; public var superuser:Boolean; public var organization:Organization; public var users:Array; public var data:String; public function Role() { _remoteClass = pojos.Role; data = id; // for showing in list components } } My problem is that data is undefined when I try an access it, but id isnt. So the data is definately coming from my server, but data isn't being set to id when id gets set. What am I doing wrong? HELP! Thanks in advance... Yahoo! Groups Sponsor ADVERTISEMENT http://us.ard.yahoo.com/SIG=1298lpq25/M=298184.6191685.7192823.3001176/D=gr http://us.ard.yahoo.com/SIG=1298lpq25/M=298184.6191685.7192823.3001176/D=gr oups/S=1705007207:HM/EXP=976062/A=2593423/R=0/SIG=11el9gslf/*http:/www.n etflix.com/Default?mqso=60190075 click here http://us.adserver.yahoo.com/l?M=298184.6191685.7192823.3001176/D=groups/S= http://us.adserver.yahoo.com/l?M=298184.6191685.7192823.3001176/D=groups/S= :HM/A=2593423/rand=858236756 _ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ http://groups.yahoo.com/group/flexcoders/ http://groups.yahoo.com/group/flexcoders/ http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! http://docs.yahoo.com/info/terms/ http://docs.yahoo.com/info/terms/ Terms of Service. Yahoo! Groups Sponsor ADVERTISEMENT http://us.ard.yahoo.com/SIG=129fp9kgn/M=298184.6191685.7192823.3001176/D=gr oups/S=1705007207:HM/EXP=979818/A=2593423/R=0/SIG=11el9gslf/*http:/www.n etflix.com/Default?mqso=60190075 click here http://us.adserver.yahoo.com/l?M=298184.6191685.7192823.3001176/D=groups/S= :HM/A=2593423/rand=579990054 _ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! http://docs.yahoo.com/info/terms/ Terms of Service. 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/