[flexcoders] Re: ComboBox Problems
it's got a lot of mess and debug junk, but: public function addedToStageHandler():void { Application.application.log.text += Got Add event\n; Application.application.log.text += MONTH = + monthCB.selectedIndex + \n; Application.application.log.text += DAY = + dayCB.selectedIndex + \n; Application.application.log.text += YEAR = + yearCB.selectedIndex + \n; if (date != null) { dispatchEvent(new Event(Event.CHANGE, true)); dispatchEvent(new Event(Event.RENDER, true)); Application.application.log.text += date is NOT null\n; monthCB.dispatchEvent(new Event(Event.CHANGE, true)); dayCB.dispatchEvent(new Event(Event.CHANGE, true)); dayCB.dispatchEvent(new Event(Event.RENDER, true)); yearCB.dispatchEvent(new Event(Event.CHANGE,true)); Application.application.log.text += 3 MONTH = + monthCB.selectedIndex + \n; Application.application.log.text += 3 DAY = + dayCB.selectedIndex + \n; Application.application.log.text += 3 YEAR = + yearCB.selectedIndex + \n; } else { Application.application.log.text += Date IS null\n; } } So every time it's added to the stage, I'm seeing what the values are, and the values remain constant and correct, just the option that the comboboxes are showing are incorrect. G --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: How are you verifying that selectedIndex is correct? I assume the dropdowns still contain the correct arrays? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of hardaur55 Sent: Monday, July 07, 2008 6:47 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] ComboBox Problems Hey all. Having a silly problem with 3 comboboxes and can't seem to find anything very helpful via google. I'm creating a user registration wizard with multiple pages that contains a custom component. The custom component is a date selection component consisting of 3 combo boxes (month, day, year). They are all populated with simple arrays as the dataProvider. Every thing works perfectly except. . .If you select your date (DOB in this case) and go back to a previous page in the wizard when you return to the page with the DOB control, the comboboxes are showing the prompt again. The selectedIndex/Item !IS! correct, it's just not displaying the that correct value. They're not being reinstantiated, etc. I've tried firing off CHANGE and RENDER events on the comboboxes but nothing (programatically) will force them to show the value they have for selectedIndex that I've been able to find. Anybody have any pointers on this one? Seems silly to me that the default behavior wouldn't be to always show the current selectedIndex *shrug*. Thanks! Gerald
[flexcoders] Re: ComboBox Problems
The values are correct, and I've tested explicitly setting them to see if that makes a difference. The combobox objects aren't reinstantiating, just what they're showing is switching back to default and I can't figure out a way to tell them to display the current selectedIndex. G --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: Implement the wizard using a ViewStack. The control states will not change when you navigate around. Or just set the comboBox selectedIndex on show or some other event. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of hardaur55 Sent: Monday, July 07, 2008 9:47 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] ComboBox Problems Hey all. Having a silly problem with 3 comboboxes and can't seem to find anything very helpful via google. I'm creating a user registration wizard with multiple pages that contains a custom component. The custom component is a date selection component consisting of 3 combo boxes (month, day, year). They are all populated with simple arrays as the dataProvider. Every thing works perfectly except. . .If you select your date (DOB in this case) and go back to a previous page in the wizard when you return to the page with the DOB control, the comboboxes are showing the prompt again. The selectedIndex/Item !IS! correct, it's just not displaying the that correct value. They're not being reinstantiated, etc. I've tried firing off CHANGE and RENDER events on the comboboxes but nothing (programatically) will force them to show the value they have for selectedIndex that I've been able to find. Anybody have any pointers on this one? Seems silly to me that the default behavior wouldn't be to always show the current selectedIndex *shrug*. Thanks! Gerald
[flexcoders] ComboBox Problems
Hey all. Having a silly problem with 3 comboboxes and can't seem to find anything very helpful via google. I'm creating a user registration wizard with multiple pages that contains a custom component. The custom component is a date selection component consisting of 3 combo boxes (month, day, year). They are all populated with simple arrays as the dataProvider. Every thing works perfectly except. . .If you select your date (DOB in this case) and go back to a previous page in the wizard when you return to the page with the DOB control, the comboboxes are showing the prompt again. The selectedIndex/Item !IS! correct, it's just not displaying the that correct value. They're not being reinstantiated, etc. I've tried firing off CHANGE and RENDER events on the comboboxes but nothing (programatically) will force them to show the value they have for selectedIndex that I've been able to find. Anybody have any pointers on this one? Seems silly to me that the default behavior wouldn't be to always show the current selectedIndex *shrug*. Thanks! Gerald
[flexcoders] Weird Validate Binding problem
Hello all! I have a TextInput field that is to accept a date. There is a date validator attached to the field and the text property of the date field is bound to a property in another field. Here's the code: mxml: mx:DateValidator id=validateBirthdayTI source={birthdayTI} property=text required=true/ mx:Binding source={Date.parse(birthdayTI.text)} destination=tideContext.user.birthday/ Actionscript: formIsValid = formIsValid validate(validateBirthdayTI); When the validator runs, I get the following error when doing a try/catch, otherwise it fails silently. The source attribute must be specified when the property attribute is specified. This seems to say that the source attribute for the validator isn't correct, but I don't see anything wrong with it (and other fields/properties are fine). It also seems to somehow be tied in to the binding as if I comment out the binding it works (and validates) just fine. I have a feeling I'm running up against one of those very strange Flex errors that don't mean what they say exactly ; ) Any help is very much appreciated, I've been beating on this thing off and on for a week and am getting pretty frustrated. Thanks! G
[flexcoders] Re: Weird Validate Binding problem
That was how it was originally (same error). Thought I might be having a type issue so added the Date.parse(). You can actually do it if it's specified in the braces ({}). From http://www.adobe.com/devnet/flex/quickstart/using_data_binding/ : Note: The source property of an mx:Binding tag can contain curly braces. When there are no curly braces in the source property, the value is treated as a single ActionScript expression. When there are curly braces in the source property, the value is treated as a concatenated ActionScript expression. Any other ideas? G --- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote: I may be wrong but I didn't think you could use a binding with a function. Try removing the Date.parse function from your binding tag... mx:Binding source={birthdayTI.text} destination=tideContext.user.birthday/ --- In flexcoders@yahoogroups.com, hardaur55 gander@ wrote: Hello all! I have a TextInput field that is to accept a date. There is a date validator attached to the field and the text property of the date field is bound to a property in another field. Here's the code: mxml: mx:DateValidator id=validateBirthdayTI source={birthdayTI} property=text required=true/ mx:Binding source={Date.parse(birthdayTI.text)} destination=tideContext.user.birthday/ Actionscript: formIsValid = formIsValid validate(validateBirthdayTI); When the validator runs, I get the following error when doing a try/catch, otherwise it fails silently. The source attribute must be specified when the property attribute is specified. This seems to say that the source attribute for the validator isn't correct, but I don't see anything wrong with it (and other fields/properties are fine). It also seems to somehow be tied in to the binding as if I comment out the binding it works (and validates) just fine. I have a feeling I'm running up against one of those very strange Flex errors that don't mean what they say exactly ; ) Any help is very much appreciated, I've been beating on this thing off and on for a week and am getting pretty frustrated. Thanks! G
[flexcoders] Programatically deselecting tree branch objects
Good morning all, I'm trying to set up a tree control so that branch items open and close on select just as if somebody had clicked the twirly. I've got everything taken care of but I need to find a way to programatically deselect the branch item. Here's the code problem: In my Tree change event handler public function handleTreeChangeEvent(event:Event):void { //some code if (selectedVideoId != '') { trace(selectedVideoId + is the selected video); } else { if (videoTree.isItemOpen(selectedVideo)) { videoTree.expandItem(selectedVideo, false, true); // I now need to deselect this tree item } else { videoTree.expandItem(selectedVideo, true, true); // I now need to deselect this tree item. } } } See the // comments for details on what I'm trying to do. I very much appreciate any light anybody can shine on this, I've been beating up google and the API docs for the last few hours with no results. Thanks!! H
[flexcoders] Re: How to expand TREE Node children by clicking folder icon instead of triangle
Mubasher, Hi, I'm doing the same thing you are. You can see some code that makes it happen at http://tech.groups.yahoo.com/group/flexcoders/message/86441 However, you'll run into the same problem I am : ( H --- In flexcoders@yahoogroups.com, mubasherhaneef [EMAIL PROTECTED] wrote: I have a question regarding opening of tree branch node; In a tree, a branch node can contain multiple child nodes, and, by default, appears as a folder icon with a disclosure triangle that lets users open and close the folder but I was trying to open child node/folder, when user will click either on triangle or on folder icon. I tried the below mentioned code but that expands all the nodes children of tree instead of expanding one node children; Any help, suggestions or code example should be appreciated. Regards, Mubasher mx:Script ![CDATA[ public function treeChanged(event:Event):void { selectedNode=Tree(event.target).selectedItem as XML; if([EMAIL PROTECTED] == My node){ //myTree.expandItem(treeData,true); myTree.expandChildrenOf(myTree.dataProvider[0],true); } ]] /mx:Script mx:XML id=treeData node label=root Node node label=My node node label=myNode1 data=myNode1/ node label=myNode2 data=myNode2/ node label=myNode3 data=myNode3/ /node node label=My Profile node label=Change Password data=password/ node label=Personal data=personal/ node label=Contact Info data=contact/ /node /node /mx:XML mx:Tree id=myTree width=100% height=100% labelField=@label backgroundColor=#BEC7CC showRoot=true useHandCursor=true dataProvider={treeData} change=treeChanged(event)/
[flexcoders] Re: Programatically deselecting tree branch objects
for posterity, I finally came up with a decent solution. To programatically deselect an item from a Tree: treeObjectName.selectedItem = null; Hope that helps somebody at some point. H --- In flexcoders@yahoogroups.com, hardaur55 [EMAIL PROTECTED] wrote: Good morning all, I'm trying to set up a tree control so that branch items open and close on select just as if somebody had clicked the twirly. I've got everything taken care of but I need to find a way to programatically deselect the branch item. Here's the code problem: In my Tree change event handler public function handleTreeChangeEvent(event:Event):void { //some code if (selectedVideoId != '') { trace(selectedVideoId + is the selected video); } else { if (videoTree.isItemOpen(selectedVideo)) { videoTree.expandItem(selectedVideo, false, true); // I now need to deselect this tree item } else { videoTree.expandItem(selectedVideo, true, true); // I now need to deselect this tree item. } } } See the // comments for details on what I'm trying to do. I very much appreciate any light anybody can shine on this, I've been beating up google and the API docs for the last few hours with no results. Thanks!! H