Hi Friends,
here is my problem statement.In my application, i have a button and
on click of it,opens a popup-window(say FriendsComp) in which i have
declared one public arrayCollection variable and it has one more
component(say MyFriendsList) included in it. In MyFriendsList
component,am displaying the all of my friends with picture and as well
as name.you can select the friends by clicking on it and add them item
into the array collection which is decalred in FriendsComp and if it
is already there then remove it and the selected friends will be
displayed in another component.
In my popup-window(FriendsComp),search option is available i .e. you
can search for a friend and add to it the same array collection
variable and if it is already there then don't add it.
But some how am not able to get it working.So any one can help me on
this.
Thanks in advance.
here is the code.................
parent component (FriendsComp)
[Bindable] public var selectedFBFrnds:ArrayCollection = new
ArrayCollection();
private function onKeyDown(event:KeyboardEvent):void {
if (event.keyCode == Keyboard.ENTER)
{
if (selectedFBFrnds.length >= 0 &&
fbFreindSelectedList.selectedItem != null) {
if(selectedFBFrnds.contains
(fbFreindSelectedList.selectedItem)) {
Alert.show("don't add me");
}
else {
Alert.show("add");
selectedFBFrnds.addItem
(fbFreindSelectedList.selectedItem);
}
}
}
}
<comp:MyFriendsList parentRef={this} />
i have a component for search and that has the keyDown event
another component ( MyFriendsList)
here am using the TileList and it has the itemClick event to select
the friends
public var parentref:FriendsComp = null
private function getSelectedFBFriends(event:Event):void {
if (parentRef.selectedFBFrnds.length >=0 &&
fbFrndsList.selectedItem != null) {
if (parentRef.selectedFBFrnds.contains
(fbFrndsList.selectedItem)) {
Alert.show("if");
parentRef.selectedFBFrnds.removeItemAt
(parentRef.selectedFBFrnds.getItemIndex(fbFrndsList.selectedItem));
}
else {
Alert.show("else");
parentRef.selectedFBFrnds.addItem
(fbFrndsList.selectedItem);
}
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---