hi

i have some problem in treeprogram which i made and  code below(i am not
getting any value in searchResult please let me know  ):-

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
 <fx:XML id="data" xmlns="">
 <companydata>
<node name="Finance">
<leaf name="priti"/>
<leaf name="Neha" />
<leaf name="Shalima"/>
</node>
 <node name="IT">
<leaf name="John"/>
<leaf name="Mike" />
<leaf name="Paul"/>
<leaf name="Jimi"/>
</node>
<node name="Operation">
<leaf name="Divas"/>
<leaf name="Neeraj"/>
</node>
</companydata>
</fx:XML>
 </fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
import mx.controls.Alert;
 [Bindable]
private var searchResult:XMLList;
private var searchResultIndex:uint = 0;
 private function findByName(event:MouseEvent):void
{
 var searchStr:String = searchNameInput.text;
if (searchStr.length == 0) {
Alert.show("Provide a search string.");
return;
}
 tree.expandChildrenOf(data[0], false);
  searchResult = data.node.leaf.(@name);
 if(searchStr==searchResult.attributes())
{
Alert.show("Found");
}
 }
]]>
</fx:Script>
  <mx:Panel title="Tree Search" height="100%" width="100%">
<mx:HBox width="100%">
<mx:TextInput id="searchNameInput" />
<mx:Button label="Search by name" click="findByName(event)" />
 </mx:HBox>
 <mx:Tree id="tree" width="100%" height="100%"
 showRoot="false" dataProvider="{data}"
 labelField="@name" />
</mx:Panel>
  </s:Application>


On Tue, Feb 7, 2012 at 5:13 AM, Sagar Kapadiya <[email protected]>wrote:

> you can use adobe training video and flex cookbook to learn
> flex...........
>
> --
> 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.
>

-- 
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.

Reply via email to