[flexcoders] Dynamic RadioButtonGroup
I am trying to dynamically create radio buttons within a radiobuttongroup (which is dynamically being created). This appears to work. But, when I try to get the data out of the dynamically created RadioButtonGroup, I get undefined. I can tell that the group exists because I can see that path that the object is in. If I try to do any properties on the Group I get undefined. Even the ID property returns undefined. Does anyone have any experience with creating a dynamic RadioButtonGroup and how I would go about getting the data out? Here is a simplified version of my code with only one RadioButtonGroup that isn't being named dynamically, should be doing about the same thing though. function appComp() { list = new Object(); rbg = cont.createChild(RadioButtonGroup, undefined, {id: group1}); list[0] = rbg; for (var i=0; i10; i++) { var rb = cont.createChild(RadioButton); rb.groupName=rbg.id; rb.label=rb.groupName; } //This shows correctly sOutput += list[0].id; } function btnPush() { //This shows me the path of the RadioButtonGroup sOutput += list[0]; sOutput += list[0].id; // = undefined sOutput += list[0].selection.id; // = undefined } -- 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: Passing parameter from panel to popupwindow
You need to pass the data as a variable to the popup. In your app Script tag do this: mx:Script var dataPassed; function showWindow(modal) { var popup = mx.managers.PopUpManager.createPopUp(_root, LogonWindow, modal, {deferred: true}); popup.dataPassed = //(whatever you want to pass); } And then in your pop up add the variable inside the script there. Then you can just call that variable and work with it as you please. In the popup: mx:Script var dataPassed; /mx:Script mx:FormItem label=UserId required=true mx:TextInput id=userId width=150 text={dataPassed}/ /mx:FormItem Hope that works for you. 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: Control Tree with a Button
Matt, how do I get at the dataProvider to use the methods? I tried adding the nodes to the dataProvider dynamically but that didn't work. Little more info would be helpful. Thanks. --- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote: Check out the TreeDataProvider API in the ASDoc. You'll see the methods you should use. Tree.dataProvider should provide you with the root of the tree. Matt _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jwaknitz Sent: Wednesday, May 04, 2005 12:53 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Control Tree with a Button Anyone know how I would be able to go through nodes of a tree using a button? My tree has two levels and I would like to be able to go through just the child nodes for each parent node. Can anyone show me some code to do this? I'm stumped. I'm dynamically adding nodes to the tree. mx:Tree id=treeMenu indentation=3 height=100% width=100% change=changeMenu() defaultLeafIcon= folderClosedIcon= folderOpenIcon= / _ 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] subject=Unsubscribe * 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] Control Tree with a Button
Anyone know how I would be able to go through nodes of a tree using a button? My tree has two levels and I would like to be able to go through just the child nodes for each parent node. Can anyone show me some code to do this? I'm stumped. I'm dynamically adding nodes to the tree. mx:Tree id=treeMenu indentation=3 height=100% width=100% change=changeMenu() defaultLeafIcon= folderClosedIcon= folderOpenIcon= / 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: HTTPService and dynamic url
Ya, I got something similar to this working. Just added a function on the Change event of the ComboBox. Just make sure in the function you set the send function to the http service. mx:ComboBox id=ComboBx change=changeCombo()/ function changeCombo(){ service.url = ComboBx.currentItem.data; service.send() } --- In flexcoders@yahoogroups.com, Jeff Beeman [EMAIL PROTECTED] wrote: Hi, all, I'm new to the list and to Flex, but a long-time Flash-er. I've been lurking a couple of days and finally noticed a question I might actually be able to help out on! I think if you bind the url attribute to an object's property, instead of a function, you may have more success. At this point, it doesn't know when to fire the getLanguage() function. If it is bound to an object's property, which you could update on button presses, etc., it would be able to watch that property and call the service when it changes. I'm fairly new to Flex, so I won't guarantee it'll work, but that method works with other objects (data grids, charts, etc.) Tracy's solution should work too (although, I've never done it myself), and you'll have to set the property on an event, i.e.: Button id=myButton click=loadXML(); / ... function loadXML() { // ... // set your url string here // ... my_service.url = myXmlString; } /** * Jeff Beeman **/ _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Thursday, April 28, 2005 10:05 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] HTTPService and dynamic url Have you tried setting it programmatically instead of binding? Tracy _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of david_gal-reyniez Sent: Thursday, April 28, 2005 12:09 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTPService and dynamic url Hello everyone! My problem is the following: I try to affect dynamically the url of my HTTPService component. But even if the value of the url that I generate is good, the url property of my HTTPService is not affected. I'm interested by any kind of suggestions. Thanks for your help! Special thanks to Abdul for the link he mentioned concerning the multi-language feature and for Manish for his article... The function which initialize my HTTPService call mx:Application width=100% height=100% xmlns:mx=http://www.macromedia.com/2003/mxml; initialize=initAppli() public function initAppli() { srvLocaleService.send(); }*** Script defining the HTTService in my Application It works correctly mx:HTTPService id=srvLocaleService url=xml/lg_ENG.xml result=resultHandler_H1_R(event.result) fault=resultHandler_H1_F(event.fault) / mx:Model id=locale { srvLocaleService.result.strings } /mx:Model But this one not mx:HTTPService id=srvLocaleService url={ getLanguage() } result=resultHandler_H1_R(event.result) fault=resultHandler_H1_F(event.fault) / mx:Model id=locale { srvLocaleService.result.strings } /mx:Model Script defining the language I desired public function getLanguage():String { var item:Object = accUSA.cbLstLanguages.selectedItem; // The selected language come from one ComboBox var itemLabel:String = item.toString(); language = xml/lg_+itemLabel+.xml; return language; } *** The xml I call to define the button's label I want ?xml version=1.0 encoding=iso-8859-1? strings btnFindLabelfind/btnFindLabel /strings *** The code I use to affect the label of the concerned button mx:Button styleName=btn label={ locale.btnFindLabel } Bye David * *** * Coface facilite les echanges entre les entreprises partout dans le monde. Pour cela, elle offre a toutes les entreprises des solutions pour gerer, financer et proteger leur poste client, en leur permettant d'externaliser tout ou partie de la gestion et des risques lies a leurs relations commerciales. Coface est notee AA par Fitch Ratings et Aa3 par Moody's. Pour en savoir plus, http://www.coface.fr Coface facilitates business-to-business commerce worldwide. It offers all size companies an array of solutions to manage, finance, and protect their accounts receivables affording them the option of fully or partly outsourcing trade relationship management and attendant risks. Coface is rated AA by Fitch ratings and Aa3 by Moody's. More about Coface, http://www.coface.com WARNING : - Soyez conscient que notre systeme Anti-Spam peut parfois rejeter des
[flexcoders] Re: Radio Button Custom Component
I went back to the script and changed the if statement to create a RadioButton directly to the app and not grab a component. This fixed the group problem but is not the fix that I wanted. Components is much nicer for what I want as the other way has generated a few problems with my design. Does anyone have any input about why the groupName attribute doesn't seem to work between components? --- In flexcoders@yahoogroups.com, Matthew Shirey [EMAIL PROTECTED] wrote: I am working with Jack and I am familiar with his problem. There's a few reasons why we're using a component with a radio control inside it. Our problem is that it seems to be ignoring the groupName property. Do radio controls have to all exist inside the same parent container to work as a group? I have looked in the documentation and didn't see any such limitation. Maybe I missed it. Shouldn't you be able to put radio buttons anywhere in the application and as long as they all have the same groupName they all behave as a group? -- Matthew On 4/13/05, Tracy Spratt [EMAIL PROTECTED] wrote: Why not just use straight mxml. The following works for me. mx:VBox id=vboxRG x=3 y=3 mx:Repeater id=repeaterRB dataProvider={leParameter.valuesarray} mx:RadioButton id=RBParameter groupName=RGBParameter data={repeaterRB.currentItem[0]} label={repeaterRB.currentItem[labelColumn]} click=setParameterValue(event) width={this.width-6}/ /mx:Repeater /mx:VBox Tracy -Original Message- From: jwaknitz [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 13, 2005 1:16 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Radio Button Custom Component I'm using a repeater to grab a component that makes a radiobutton each time. When the app is displayed, there are 7 radiobuttons. The problem is, they are not in the same group. They are all individually checkable. I went into the component and gave the radiobutton a groupName=group1. All of the radiobuttons then had the same groupName. The problem was still there. I also tried putting the component call within a RadioButtonGroup component and had no luck. Anyone have any solutions to this? ** App: mx:Script ![CDATA[ var compData3:Object; var compData4:Object; function repeaterfunc(){ if(repradio.currentItem.nodeName == response_lid){ compData3 = cont.createChild (Components.RadioButtons.labelbuttoncomp); compData3.compData4 = repradio.currentItem; } } ]] /mx:Script mx:Repeater id=repradio dataProvider={compData2.childNodes [1].firstChild.childNodes} repeat=repeaterfunc()/ mx:VBox id=cont/mx:VBox ** Component: mx:Script ![CDATA[ var compData4; ]] /mx:Script mx:RadioButton label={compData4.firstChild.firstChild.firstChild.firstChild.firstCh ild.firstChild} groupName=group1 labelPlacement=right/ 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] Radio Button Custom Component
I'm using a repeater to grab a component that makes a radiobutton each time. When the app is displayed, there are 7 radiobuttons. The problem is, they are not in the same group. They are all individually checkable. I went into the component and gave the radiobutton a groupName=group1. All of the radiobuttons then had the same groupName. The problem was still there. I also tried putting the component call within a RadioButtonGroup component and had no luck. Anyone have any solutions to this? ** App: mx:Script ![CDATA[ var compData3:Object; var compData4:Object; function repeaterfunc(){ if(repradio.currentItem.nodeName == response_lid){ compData3 = cont.createChild (Components.RadioButtons.labelbuttoncomp); compData3.compData4 = repradio.currentItem; } } ]] /mx:Script mx:Repeater id=repradio dataProvider={compData2.childNodes [1].firstChild.childNodes} repeat=repeaterfunc()/ mx:VBox id=cont/mx:VBox ** Component: mx:Script ![CDATA[ var compData4; ]] /mx:Script mx:RadioButton label={compData4.firstChild.firstChild.firstChild.firstChild.firstCh ild.firstChild} groupName=group1 labelPlacement=right/ 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: Radio Button Custom Component
I need to use the components so I can test what type of node is in the XML. I'm calling different components based on nodeName. --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: Why not just use straight mxml. The following works for me. mx:VBox id=vboxRG x=3 y=3 mx:Repeater id=repeaterRB dataProvider={leParameter.valuesarray} mx:RadioButton id=RBParameter groupName=RGBParameter data={repeaterRB.currentItem[0]} label={repeaterRB.currentItem[labelColumn]} click=setParameterValue(event) width={this.width-6}/ /mx:Repeater /mx:VBox Tracy -Original Message- From: jwaknitz [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 13, 2005 1:16 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Radio Button Custom Component I'm using a repeater to grab a component that makes a radiobutton each time. When the app is displayed, there are 7 radiobuttons. The problem is, they are not in the same group. They are all individually checkable. I went into the component and gave the radiobutton a groupName=group1. All of the radiobuttons then had the same groupName. The problem was still there. I also tried putting the component call within a RadioButtonGroup component and had no luck. Anyone have any solutions to this? ** App: mx:Script ![CDATA[ var compData3:Object; var compData4:Object; function repeaterfunc(){ if(repradio.currentItem.nodeName == response_lid){ compData3 = cont.createChild (Components.RadioButtons.labelbuttoncomp); compData3.compData4 = repradio.currentItem; } } ]] /mx:Script mx:Repeater id=repradio dataProvider={compData2.childNodes [1].firstChild.childNodes} repeat=repeaterfunc()/ mx:VBox id=cont/mx:VBox ** Component: mx:Script ![CDATA[ var compData4; ]] /mx:Script mx:RadioButton label={compData4.firstChild.firstChild.firstChild.firstChild.firstCh ild.firstChild} groupName=group1 labelPlacement=right/ 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] nodeName
Hello, I was wondering if there is anyway to grab the name of a node to test against it not using an XML object. I'm using data right from an HTTP service and don't want it to be in XML format either. Any ideas? I know it can be done quickly with XML but that would mean remaking my entire app, not an option. Could I create an XML object that grabs a variable from the HTTP Service? If so, how? I'm really stuck. 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] ComboBox Label
Hello, I am having problems with the ComboBox component. I want to use the xml: render_choice response_label ident=A material mattextLess than $200/mattext /material /response_label response_label ident=B material mattext$201-$400/mattext /material /response_label response_label ident=C material mattext$401-$800/mattext /material /response_label So I did: mx:ComboBox dataProvider={xml.render_choice.response_label}/ The problem is, how do I set the label to the mattext that is two elements down? I tried doing labelField=material.mattext and labelField=material['mattext'], neither worked. How do I go about setting the label correctly? Am I going to have to do a labelFunction? 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/