private function doSearch():void { myAttributeTable.refresh(); myAttributeTable.visible = false ac = new ArrayCollection(); ac.addItem({name:"Alpine",code:"AL"}); ac.addItem({name:"Austin",code:"AU"}); ac.addItem({name:"Referral - Consulting Forester",code:"RC"}); ac.addItem({name:"Referral Vendor", code:"RV"}); ac.addItem({name:"Incidental Rural Forestry",code:"AIR"}); ac.addItem({name:"Prevention and Reduction of Pest Losses",code:"AP"}); ac.addItem({name:"Forest Health Monitoring - Survey",code:"FHS"}); myAttributeTable.featureLayer = myFeatureLayer myAttributeTable.featureLayer = yourTable myAttributeTable.visible = true ac.filterFunction = filter; ac.refresh() var itemname:String = ac.getItemAt(0).name Alert.show(itemname) var itemname1:String = ac.getItemAt(1).name Alert.show(itemname1) var qText2:String = ac.getItemAt(0).code var qText3:String = ac.getItemAt(1).code var qText4:String = ac.getItemAt(2).code Alert.show(qText2) Alert.show(qText3) yourTable.refresh() if (ac.length == 1) { Alert.show("TEST AC LENGTH 1") var defexpr:String = searchattribute + "like" + "'" + qText2 + "'"; yourTable.definitionExpression = defexpr } else if (ac.length == 2) { Alert.show("TEST AC LENGTH 2") var defexpr2:String = searchattribute + eqsymbol + "'" + qText2 + "'" + " OR " + searchattribute + eqsymbol + "'" + qText3 + "'"; yourTable.definitionExpression = defexpr2 myAttributeTable.featureLayer = yourTable myAttributeTable.visible = true } else if (ac.length == 3) { Alert.show("TEST AC LENGTH 3") var defexpr3:String = searchattribute + eqsymbol + "'" + qText2 + "'" + " OR " + searchattribute + eqsymbol + "'" + qText3 + "'" + " OR " + searchattribute + eqsymbol + "'" + qText4 + "'"; yourTable.definitionExpression = defexpr3 Alert.show(defexpr3) myAttributeTable.featureLayer = yourTable myAttributeTable.visible = true } else if (ac.length > 2) { Alert.show("TEST AC LENGTH ELSE") myAttributeTable.visible = false Alert.show("Please review your search and try again") } }
[Bindable] private var ac:ArrayCollection; public function filter(item:Object):Boolean { var name:String = String(item["name"]); var beginsWithString:String = qText.text.toLowerCase(); return name.toLowerCase().indexOf(beginsWithString) > -1; } private function doSearch():void { myAttributeTable.refresh(); myAttributeTable.visible = false ac = new ArrayCollection(); ac.addItem({name:"Alpine",code:"AL"}); ac.addItem({name:"Austin",code:"AU"}); ac.addItem({name:"Referral - Consulting Forester",code:"RC"}); ac.addItem({name:"Referral Vendor", code:"RV"}); ac.addItem({name:"Incidental Rural Forestry",code:"AIR"}); ac.addItem({name:"Prevention and Reduction of Pest Losses",code:"AP"}); ac.addItem({name:"Forest Health Monitoring - Survey",code:"FHS"}); myAttributeTable.featureLayer = myFeatureLayer myAttributeTable.featureLayer = yourTable myAttributeTable.visible = true ac.filterFunction = filter; ac.refresh() var itemname:String = ac.getItemAt(0).name Alert.show(itemname) var itemname1:String = ac.getItemAt(1).name Alert.show(itemname1) var qText2:String = ac.getItemAt(0).code var qText3:String = ac.getItemAt(1).code Alert.show(qText2) Alert.show(qText3) yourTable.refresh() if (ac.length == 1) { Alert.show("TEST AC LENGTH 1") var defexpr:String = searchattribute + "like" + "'" + qText2 + "'"; yourTable.definitionExpression = defexpr } else if (ac.length == 2) { Alert.show("TEST AC LENGTH 2") var defexpr2:String = searchattribute + eqsymbol + "'" + qText2 + "'" + " OR " + searchattribute + eqsymbol + "'" + qText3 + "'"; yourTable.definitionExpression = defexpr2 myAttributeTable.featureLayer = yourTable myAttributeTable.visible = true } else if (ac.length > 2) { Alert.show("TEST AC LENGTH ELSE") myAttributeTable.visible = false Alert.show("Please review your search and try again") } }
Any confirmation this bug is fixed with 10SP1?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.