RE: [flexcoders] help enabling or disabling a control when a user selects something - Solved
okay, now just one more thing that works, in that it disables the listbox on the right, now I have made a button on the file that runs the following AS code when clicked: function resetForm(){ srcgrid.enabled = !srcgrid.enabled } so that works in that it enables the listbox, but if i drag All Reports back into the originiating listbox then drag it back into the destination listbox control box,(it should disable the box) it doesn't disable the control... what in the world am I doing wrong. It should be a simple thing to enable / disable a control based on the selectionh Craig --- Craig Newroth [EMAIL PROTECTED] wrote: Thanks Tracy for getting me on the right track.!!! In the action script file that I posted here is what I changed/added in the below function to make it work... Now all I have to do is do a test on it to see if they selected it somewhere in the middle of the process. :-) ** function doDragDrop(event) { doDragExit(event); var items = event.dragSource.dataForFormat(items); var dest = event.target; var dropLoc = dest.getDropLocation(); items.reverse(); for(var i = 0; i items.length; i++) { dest.addItemAt(dropLoc,items[i]); // * THE CHANGE/ADDED CODE ** // Check to see if the drop location contains 'All Reports', if is does then disable the srcgrid so the user cannot select any other reports if (dropLoc,items[i] == 'All Reports'){ srcgrid.enabled = !srcgrid.enabled; } } } * --- Tracy Spratt [EMAIL PROTECTED] wrote: The enable toggle works correctly right? Say if you were to run it directly from a button? And the drag/drop works correctly? Your code wasn't complete enough for me to run, so I need to ask, When you drag an item into the list, is it automatically selected? If so, you want to test: event.target.selectedItem.label == All Reports (or whatever the label column property is named) If not, you will need to iterate through the items to see if the All Reports option is included. Can you extract the issue into a simple example? Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Craig Newroth Sent: Friday, May 06, 2005 2:05 PM To: flexcoders@yahoogroups.com Cc: [EMAIL PROTECTED] Subject: Re: [flexcoders] help enabling or disabling a control when a user selects something well, it is supposed to test for the content of the selected item and then what I want to do is enable or disable a list control.. I have tired both the number zero (the selected index) of my first list and the text value and cannot get it to work. --- Manish Jethani [EMAIL PROTECTED] wrote: On 5/5/05, cnewroth55 [EMAIL PROTECTED] wrote: if (event.target.selectedIndices == All Reports){ srcgrid.enabled = !srcgrid.enabled; } I'm sorry if this is a stupid question as I haven't gone through your entire code line by line, but what does the above if-condition want to test? 'selectedIndices' will be an array of Number objects, so I wonder if comparing it to a string like that is correct. Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html Yahoo! Groups Links Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html Discover Yahoo! Stay in touch with email, IM, photo sharing and more. Check it out! http://discover.yahoo.com/stayintouch.html Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] help enabling or disabling a control when a user selects something - Solved
Ppl.. Who is Ben Forta?.. :-) David Manriquez Desarrollador [EMAIL PROTECTED] (+56-2) 43 00 155 -Mensaje original- De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] En nombre de Craig Newroth Enviado el: MiƩrcoles, 11 de Mayo de 2005 9:43 Para: flexcoders@yahoogroups.com Asunto: RE: [flexcoders] help enabling or disabling a control when a user selects something - Solved okay, now just one more thing that works, in that it disables the listbox on the right, now I have made a button on the file that runs the following AS code when clicked: function resetForm(){ srcgrid.enabled = !srcgrid.enabled } so that works in that it enables the listbox, but if i drag All Reports back into the originiating listbox then drag it back into the destination listbox control box,(it should disable the box) it doesn't disable the control... what in the world am I doing wrong. It should be a simple thing to enable / disable a control based on the selectionh Craig --- Craig Newroth [EMAIL PROTECTED] wrote: Thanks Tracy for getting me on the right track.!!! In the action script file that I posted here is what I changed/added in the below function to make it work... Now all I have to do is do a test on it to see if they selected it somewhere in the middle of the process. :-) ** function doDragDrop(event) { doDragExit(event); var items = event.dragSource.dataForFormat(items); var dest = event.target; var dropLoc = dest.getDropLocation(); items.reverse(); for(var i = 0; i items.length; i++) { dest.addItemAt(dropLoc,items[i]); // * THE CHANGE/ADDED CODE ** // Check to see if the drop location contains 'All Reports', if is does then disable the srcgrid so the user cannot select any other reports if (dropLoc,items[i] == 'All Reports'){ srcgrid.enabled = !srcgrid.enabled; } } } * --- Tracy Spratt [EMAIL PROTECTED] wrote: The enable toggle works correctly right? Say if you were to run it directly from a button? And the drag/drop works correctly? Your code wasn't complete enough for me to run, so I need to ask, When you drag an item into the list, is it automatically selected? If so, you want to test: event.target.selectedItem.label == All Reports (or whatever the label column property is named) If not, you will need to iterate through the items to see if the All Reports option is included. Can you extract the issue into a simple example? Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Craig Newroth Sent: Friday, May 06, 2005 2:05 PM To: flexcoders@yahoogroups.com Cc: [EMAIL PROTECTED] Subject: Re: [flexcoders] help enabling or disabling a control when a user selects something well, it is supposed to test for the content of the selected item and then what I want to do is enable or disable a list control.. I have tired both the number zero (the selected index) of my first list and the text value and cannot get it to work. --- Manish Jethani [EMAIL PROTECTED] wrote: On 5/5/05, cnewroth55 [EMAIL PROTECTED] wrote: if (event.target.selectedIndices == All Reports){ srcgrid.enabled = !srcgrid.enabled; } I'm sorry if this is a stupid question as I haven't gone through your entire code line by line, but what does the above if-condition want to test? 'selectedIndices' will be an array of Number objects, so I wonder if comparing it to a string like that is correct. Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html Yahoo! Groups Links Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html Discover Yahoo! Stay in touch with email, IM, photo sharing and more. Check it out! http://discover.yahoo.com/stayintouch.html 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/
RE: [flexcoders] help enabling or disabling a control when a user selects something
Tracy: I have attached the files that I am using as weel as the AS file for control...in the as file look around line 58 for the code that I am trying. You will need to comment out the ones that do the topmenu and the display. StandardReports.mxml is the file in question. WHen I select all reports from srcgrid and drag it into destgrid I want 'srcgrid' to be disabled... thanks, Craig --- Tracy Spratt [EMAIL PROTECTED] wrote: The enable toggle works correctly right? Say if you were to run it directly from a button? And the drag/drop works correctly? Your code wasn't complete enough for me to run, so I need to ask, When you drag an item into the list, is it automatically selected? If so, you want to test: event.target.selectedItem.label == All Reports (or whatever the label column property is named) If not, you will need to iterate through the items to see if the All Reports option is included. Can you extract the issue into a simple example? Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Craig Newroth Sent: Friday, May 06, 2005 2:05 PM To: flexcoders@yahoogroups.com Cc: [EMAIL PROTECTED] Subject: Re: [flexcoders] help enabling or disabling a control when a user selects something well, it is supposed to test for the content of the selected item and then what I want to do is enable or disable a list control.. I have tired both the number zero (the selected index) of my first list and the text value and cannot get it to work. --- Manish Jethani [EMAIL PROTECTED] wrote: On 5/5/05, cnewroth55 [EMAIL PROTECTED] wrote: if (event.target.selectedIndices == All Reports){ srcgrid.enabled = !srcgrid.enabled; } I'm sorry if this is a stupid question as I haven't gone through your entire code line by line, but what does the above if-condition want to test? 'selectedIndices' will be an array of Number objects, so I wonder if comparing it to a string like that is correct. Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html Yahoo! Groups Links Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html 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/ DragEventHandlers.as Description: 229667049-DragEventHandlers.as standardReports.mxml Description: 767879685-standardReports.mxml gvsStartA.mxml Description: 2325252969-gvsStartA.mxml
Re: [flexcoders] help enabling or disabling a control when a user selects something
well, it is supposed to test for the content of the selected item and then what I want to do is enable or disable a list control.. I have tired both the number zero (the selected index) of my first list and the text value and cannot get it to work. --- Manish Jethani [EMAIL PROTECTED] wrote: On 5/5/05, cnewroth55 [EMAIL PROTECTED] wrote: if (event.target.selectedIndices == All Reports){ srcgrid.enabled = !srcgrid.enabled; } I'm sorry if this is a stupid question as I haven't gone through your entire code line by line, but what does the above if-condition want to test? 'selectedIndices' will be an array of Number objects, so I wonder if comparing it to a string like that is correct. Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] help enabling or disabling a control when a user selects something
The enable toggle works correctly right? Say if you were to run it directly from a button? And the drag/drop works correctly? Your code wasn't complete enough for me to run, so I need to ask, When you drag an item into the list, is it automatically selected? If so, you want to test: event.target.selectedItem.label == All Reports (or whatever the label column property is named) If not, you will need to iterate through the items to see if the All Reports option is included. Can you extract the issue into a simple example? Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Craig Newroth Sent: Friday, May 06, 2005 2:05 PM To: flexcoders@yahoogroups.com Cc: [EMAIL PROTECTED] Subject: Re: [flexcoders] help enabling or disabling a control when a user selects something well, it is supposed to test for the content of the selected item and then what I want to do is enable or disable a list control.. I have tired both the number zero (the selected index) of my first list and the text value and cannot get it to work. --- Manish Jethani [EMAIL PROTECTED] wrote: On 5/5/05, cnewroth55 [EMAIL PROTECTED] wrote: if (event.target.selectedIndices == All Reports){ srcgrid.enabled = !srcgrid.enabled; } I'm sorry if this is a stupid question as I haven't gone through your entire code line by line, but what does the above if-condition want to test? 'selectedIndices' will be an array of Number objects, so I wonder if comparing it to a string like that is correct. Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html 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] help enabling or disabling a control when a user selects something
What I am trying to do (with out much success) is to disable the one list container(srcgrid) if a person drags All Reports into the destination list container(destgrid), I have tried using selectedIndices with both the text and the value of zero as this is the index of all reports but it doesn't work, can anyone help? ...here is my mxml code: standardReports.mxml ?xml version=1.0 encoding=utf-8? mx:VBox xmlns:mx=http://www.macromedia.com/2003/mxml; width=100% mx:Script function changeOther( event ) { if ( event.target == summaryCHB ) detailCHB.enabled = ! detailCHB.enabled; if ( event.target == detailCHB ) summaryCHB.enabled = ! summaryCHB.enabled; if ( event.target == summaryCHB2 ) detailCHB2.enabled = ! detailCHB2.enabled; if ( event.target == detailCHB2 ) summaryCHB2.enabled = ! summaryCHB2.enabled; if ( event.target == summaryCHB3 ) detailCHB3.enabled = ! detailCHB3.enabled; if ( event.target == detailCHB3 ) summaryCHB3.enabled = ! summaryCHB3.enabled; } /mx:Script mx:Script source=DragEventHandlers.as/ mx:Script ![CDATA[ var thrustData:Array = [All Reports, ASMT - Affordable Structures Mfg. Tech., ALE - Advanced Lean Efficient, ASC - Advanced Support Concepts, APS - Advanced Platform Systems, NCO - Netcentric Operations ]; ]] /mx:Script !-- Create a LinkBar container to navigate the ViewStack container. -- mx:LinkBar dataProvider=myViewStack width=100% borderStyle=inset borderColor=#123154 textRollOverColor=#00CC00 disabledColor=#A1C472 backgroundImage=@Embed('_images/viewstk_bkgrnd.png') backgroundSize=100% / !-- Define the ViewStack and the three child containers. -- mx:ViewStack id=myViewStack borderStyle=inset borderColor=#123154 width=100% height=100% backgroundImage=@Embed('_images/viewstk_bkgrnd.png') backgroundSize=100% mx:Canvas id=thrustRPTS label=Thrust Reports width=708 height=238 mx:Label text=Thrust Reports x=0 y=2 color=#A1C472 / mx:HBox x=320 y=183 mx:FormItem mx:CheckBox label=Summary color=#123154 labelPlacement=top id=summaryCHB click=changeOther( event );/ /mx:FormItem mx:FormItem mx:CheckBox label=Detail color=#123154 labelPlacement=top id=detailCHB click=changeOther( event );/ /mx:FormItem /mx:HBox mx:HBox x=5 y=20 mx:List id=srcgrid width=265 height=150 multipleSelection=true dataProvider={thrustData} dragEnabled=true dragEnter=doDragEnter (event) dragExit=doDragExit(event) dragDrop=doDragDrop(event) dragOver=doDragOver(event) dragComplete=doDragComplete(event) toolTip=Drag any of these items to the box on the right. x=-6 y=21/ mx:List id=destgrid width=265 height=150 multipleSelection=true dragEnabled=true dragEnter=doDragEnter(event) dragExit=doDragExit(event) dragDrop=doDragDrop(event) dragOver=doDragOver(event) dragComplete=doDragComplete(event) / /mx:HBox mx:Text x=5 y=175 text=Drag amp; Drop your selecions into the box on the right width=265 height=35 / /mx:Canvas mx:Canvas id=businessUnitRPTS label=Business Unit Reports width=100% height=100% mx:Label text=Business Unit Reports color=#A1C472 / mx:Link label=Aerospace Support x=4 y=24 alpha=0 textRollOverColor=#00CC00 color=#123154 / mx:Link label=Air Force Systems x=4 y=44 alpha=0 textRollOverColor=#00CC00 color=#123154 / mx:Link label=Army Systems x=4 y=64 alpha=0 textRollOverColor=#00CC00 color=#123154 / mx:Link label=Homeland Security x=4 y=84 alpha=0 textRollOverColor=#00CC00 color=#123154 / mx:Link label=IDeAS x=4 y=104 alpha=0 textRollOverColor=#00CC00 color=#123154 / mx:Link label=Missle Defense Systems x=4 y=124 alpha=0 textRollOverColor=#00CC00 color=#123154 / mx:Link label=NASA Systems x=4 y=144 alpha=0 textRollOverColor=#00CC00 color=#123154 / mx:Link label=Naval Systems x=4 y=164 alpha=0 textRollOverColor=#00CC00 color=#123154 / mx:Link label=Space amp; Intelligence Systems x=4 y=184 alpha=0 textRollOverColor=#00CC00
Re: [flexcoders] help enabling or disabling a control when a user selects something
On 5/5/05, cnewroth55 [EMAIL PROTECTED] wrote: if (event.target.selectedIndices == All Reports){ srcgrid.enabled = !srcgrid.enabled; } I'm sorry if this is a stupid question as I haven't gone through your entire code line by line, but what does the above if-condition want to test? 'selectedIndices' will be an array of Number objects, so I wonder if comparing it to a string like that is correct. 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/