-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Here is the code for the block which I am currently working on. I am
getting the correct values within the Alert Component when I select a
new School Corporation. I am also looking into the .addItem which I do
not have working at this time.
private function updateSchoolCorpNotify():ArrayCollection {
~ var arr:Array = [];
~
arr.push({Name:AvailableSchoolCorporations.selectedItem.Name,ID:AvailableSchoolCorporations.selectedItem.ID});
~ return new ArrayCollection(arr);
~ }
private function AddSchoolCorporation():void {
~
Alert.show(AvailableSchoolCorporations.selectedItem.ID.toString(), "Add
School Corporation ID", Alert.OK);
~
Alert.show(AvailableSchoolCorporations.selectedItem.Name.toString(),
"Add School Corporation Name", Alert.OK);
~ NotifySchoolCorporations = updateSchoolCorpNotify();
~ }
<mx:HBox width="98%" height="158">
~ <mx:Label text="School Corporations:"
textAlign="right" fontFamily="Arial" fontSize="12" fontWeight="bold"
width="130"/>
~ <mx:DataGrid id="AvailableSchoolCorporations"
dataProvider="{ListSchoolCorporations}" width="245">
~ <mx:columns>
~ <mx:DataGridColumn headerText="ID"
dataField="ID" visible="false" />
~ <mx:DataGridColumn
headerText="Public/Private School Corporations" dataField="Name"/>
~ </mx:columns>
~ </mx:DataGrid>
~ <mx:VBox width="57" height="141">
~ <mx:Spacer height="30"/>
~ <mx:Button label="---->"
labelPlacement="bottom" click="AddSchoolCorporation()" />
~ <mx:Spacer height="10"/>
~ <mx:Button label="<----"
labelPlacement="bottom" click="RemoveSchoolCorporation()" />
~ </mx:VBox>
~ <mx:DataGrid id="NotificationSchoolCorporations"
dataProvider="{NotifySchoolCorporations}" width="245">
~ <mx:columns>
~ <mx:DataGridColumn headerText="ID"
dataField="ID" visible="false" />
~ <mx:DataGridColumn headerText="School
Corporations To Notify" dataField="Name"/>
~ </mx:columns>
~ </mx:DataGrid>
~ </mx:HBox>
Dan Vega wrote:
| Do you have seperate dataProviders for each? If so it should not be
| overriding anything? Do you have some more code so I can see what your
| doing?
|
| Dan
|
| On Thu, Mar 6, 2008 at 2:25 PM, Graham Pearson <[EMAIL PROTECTED]>
| wrote:
|
| I am working on a new flex application which on my stage is 2 DataGrids
| separated by 2 buttons. One of hte buttons has an arrow pointing to the
| right and the other button has an arrow pointing to the left. The
| datagrid on the left hand side is populated via a Coldfusion CFC that
| lists all of the Business within a 25 mile radius of a specific zipcode.
|
| Now when I click on one of these businesses and click t he button with
| the arrow pointing to the right, I am able to display the Business in
| the Right datagrid with the following bit of code.
|
| private function updateSchoolCorpNotify():ArrayCollection {
| ~ var arr:Array = [];
| ~
| arr.push({Name:AvailableSchoolCorporations.selectedItem.Name,ID:
| AvailableSchoolCorporations.selectedItem.ID});
| ~ return new ArrayCollection(arr);
| }
|
| However when I select a second record from the left hand side, and click
| the button, It overrites the first entry which I presume it will happen
| because I am creating a new array each time the updateSchoolCorpNotify()
| is being ran. I then tried to move the arr:Array outside of the function
| with the line:
|
| [Bindable] private or public var arr:Array;
|
| however when I do this, then nothing is displayed in the right hand
| datagrid. Can anyone shed some light on how this can be done.
|>
|>
|>
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:5062
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37