Looping through an array to get the index for each measure in a combo box
Hi folks,
I am working on a web application that has two combo boxes, one for year (called yearcombo) and for measures (called myURL) for that selected year, and also two radiobuttons (in radioBtnGroup). I have two years and a bunch of measure for each year. I have a map tool tip that when you mouse over the county you see a measure for that specific year. However I have a bunch of measures for each year and I want to be able to loop through the measures (which are in an array collection inside a combobox) so my "if" expression can find every selectedIndex and bring me the tool tip for that selected measure for that selected radio button. Right now I would have to create if statements for each measure (each selectedIndex inside the myURL combobox)and each radiobutton (inside the radioBtnGroup) instead of creating a if expression to get a map tip tool for each measure. I know I would have to create a loop to search for these indexes and enter that in the if expression and also change the graphic.attributes to reflect the right measure or index selected. Do you API for Flex wizards can give me any tips on how to code this according to my code below ? Any help is greatly appreciated! (the print scree is attached)
Below is the code snippet:
if (yearcombo.selectedItem.year == "2007" && myURL.selectedIndex == 0 && radioBtnGroup.selectedValue == 0)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2007'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForDirIndOut.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
And below is the combo boxes with the arrays
<mx:FormItem label="Year :" >
<mx:ComboBox id="yearcombo" selectedIndex="0" labelField="label" width="100%" change="changeEvt(event)" >
<mx:ArrayCollection id="year" >
<fx:Object label="2007" year="2007" />
<fx:Object label="2009" year="2009" />
</mx:ArrayCollection>
</mx:ComboBox>
</mx:FormItem>
<mx:FormItem label="Measure:">
<mx:ComboBox id="myURL" selectedIndex="8" width="80%" mouseOver="clickEv2(event)" close="closeHandler(event)">
<mx:ArrayCollection id="measures" >
<fx:Object id="forindout07" labeltext="2007 Forestry Industry Output" label="Forestry Industry Output " value="RADIO_BUTTONS/TFEI_07_forest_industry_output" year="2007" />
<fx:Object id="foremp07" label="2007 Forestry Employment " value="RADIO_BUTTONS/TFEI_07_forest_employment" year="2007" />
<fx:Object id="forlabinc07" label="2007 Forestry Labor Income " value="RADIO_BUTTONS/TFEI_07_forest_labincome" year="2007" />
<fx:Object id="forindbustax07" label="2007 Forestry Indirect Business Tax" value="RADIO_BUTTONS/TFEI_07_forest_business_tax" year="2007" />
<fx:Object id="forindout09" label="Forestry Industry Output " value="RADIO_BUTTONS/TFEI_09_forest_industry_output" year="2009" />
<fx:Object id="foremp09" label="2009 Forestry Employment " value="RADIO_BUTTONS/TFEI_09_forest_employment" year="2009" />
<fx:Object id="forlabinc09" label="2009 Forestry Labor Income " value="RADIO_BUTTONS/TFEI_09_forest_labincome" year="2009" />
<fx:Object id="forindbustax09" label="2009 Forestry Indirect Business Tax" value="RADIO_BUTTONS/TFEI_09_forest_business_tax" year="2009" />
<fx:Object id="blank" label=" " />
</mx:ArrayCollection>
And here is the entire code
<?xml version="1.0" encoding="utf-8"?>
<mx: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"
xmlns:esri="http://www.esri.com/2008/ags"
paddingBottom="8" paddingLeft="8"
paddingRight="8" paddingTop="8"
backgroundColor="0xffffff"
layout="vertical" >
<!-- Start Declarations -->
<fx:Declarations>
<esri:SimpleFillSymbol id="mouseOverSymbol" alpha="0.5" color="0x808080">
<esri:SimpleLineSymbol width="0" color="#000000"/>
</esri:SimpleFillSymbol>
<esri:SimpleFillSymbol id="defaultsym" alpha="0.01" color="#E0E0E0" >
<esri:SimpleLineSymbol width="1" color="#000000"/>
</esri:SimpleFillSymbol>
<!-- End Declarations -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.esri_internal;
import com.esri.ags.events.GraphicEvent;
import com.esri.ags.geometry.Extent;
import com.esri.ags.layers.ArcGISDynamicMapServiceLayer;
import com.esri.ags.symbols.SimpleFillSymbol;
import com.esri.ags.symbols.SimpleLineSymbol;
import flash.utils.flash_proxy;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.controls.RadioButton;
import mx.controls.TextArea;
import mx.events.DropdownEvent;
import mx.events.ItemClickEvent;
import mx.rpc.Fault;
import mx.rpc.events.FaultEvent;
import flash.display.Sprite;
import flash.events.ErrorEvent;
import flash.events.MouseEvent;
private function closeHandler(evt:DropdownEvent):void {
myLabel.text = ComboBox(evt.target).selectedItem.labeltext;
private function loadLayerName():void
myLegend.layers = null;
layerPanel.removeAllChildren();
//loop through each layer and add as a radiobutton
for(var i:uint = 0; i < (dynamicLayer.layerInfos.length); i++)
var radioBtn:RadioButton = new RadioButton;
radioBtn.groupName = "radioBtnGroup";
radioBtn.value = i;
radioBtn.label = dynamicLayer.layerInfos[i].name;
if (dynamicLayer.layerInfos[i].name == "Direct Impact (Million $)")
radioBtn.label = "Direct Impact";
else if (dynamicLayer.layerInfos[i].name == "Total Impact (Million $)")
{radioBtn.label = "Total Impact";
else if (dynamicLayer.layerInfos[i].name == "Total Impact (Jobs)")
{radioBtn.label = "Total Impact";
else if (dynamicLayer.layerInfos[i].name == "Direct Impact (Jobs)")
{radioBtn.label = "Direct Impact";
else
{radioBtn.visible= false;
layerPanel.addChild(radioBtn);
/* myDividerBox.getDividerAt(0).visible = false; */
//set the visible layer the first radio button
radioBtnGroup.selectedValue = 0;
dynamicLayer.visibleLayers = new ArrayCollection([0]);
myLegend.layers = [dynamicLayer];
myLegend.visible = true;
private function radioClickHandler(event:ItemClickEvent):void
myLegend.layers = null;
// update the visible layers to only show the layer selected
dynamicLayer.visibleLayers = new ArrayCollection([event.index]);
myLegend.layers = [dynamicLayer];
private function changeEvt(event:Event):void {
if (yearcombo.selectedItem.year == "2007")
measures.filterFunction=filter1
measures.refresh()
myURL.dataProvider=measures
else if (yearcombo.selectedItem.year == "2009")
measures.filterFunction=filter2
measures.refresh();
public function filter1(item:Object):Boolean
if (item.year=="2007") return true
else return false
public function filter2(item:Object):Boolean
if (item.year=="2009") return true
else return false
private function clickEvt(event:Event):void {
if (yearcombo.selectedItem.year == "2007")
measures.filterFunction=filter3
measures.refresh()
myURL.dataProvider=measures
else if (yearcombo.selectedItem.year == "2009")
measures.filterFunction=filter4
measures.refresh();
public function filter3(item:Object):Boolean
if (item.year=="2007") return true
else return false
public function filter4(item:Object):Boolean
if (item.year=="2009") return true
else return false
private function clickEv2(event:Event):void {
if (yearcombo.selectedItem.year == "2007")
measures.filterFunction=filter5
measures.refresh()
else if (yearcombo.selectedItem.year == "2009")
measures.filterFunction=filter6
measures.refresh();
else if (yearcombo.selectedItem.year == 2007 && myURL.selectedIndex==8)
myLegend.layers = null;
layerPanel.removeAllChildren();
public function filter5(item:Object):Boolean
if (item.year=="2007") return true
else return false
public function filter6(item:Object):Boolean
if (item.year=="2009") return true
else return false
/* IF YOU WANT TO INCLUDE OTHER VALUES IN THE MAP TOOLTIP LIKE COUNTY NAME AND THE LABEL OF THE SELECTED ITEM
if (myURL.selectedIndex==0)
myTextArea.htmlText = "<b>County: </b>" + gr.attributes.NAME + "\n"
+ "<b>Measure: </b>" + myURL.selectedItem.label + gr.attributes.ForDirIndOut.toString()
public function fLayer_graphicAddHandler(event:GraphicEvent):void
event.graphic.addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
event.graphic.addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
public function onMouseOverHandler(event:MouseEvent):void
if (yearcombo.selectedItem.year == "2007" && myURL.selectedIndex == 0 && radioBtnGroup.selectedValue == 0)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2007'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForDirIndOut.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2007" && myURL.selectedIndex == 0 && radioBtnGroup.selectedValue == 1)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2007'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForTotImpIndOut.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2007" && myURL.selectedIndex == 1 && radioBtnGroup.selectedValue == 0)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2007'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForDirEmp.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2007" && myURL.selectedIndex == 1 && radioBtnGroup.selectedValue == 1)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2007'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForTotImpEmp.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2007" && myURL.selectedIndex == 2 && radioBtnGroup.selectedValue == 0)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2007'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForDirLabInc.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2007" && myURL.selectedIndex == 2 && radioBtnGroup.selectedValue == 1)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2007'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForTotImpLabInc.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2007" && myURL.selectedIndex == 3 )
fLayer.definitionExpression = "DATA_YEAR_TXT like '2007'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForIndirBusTax.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2009" && myURL.selectedIndex == 0 && radioBtnGroup.selectedValue == 0)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2009'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForDirIndOut.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2009" && myURL.selectedIndex == 0 && radioBtnGroup.selectedValue == 1)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2009'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForTotImpIndOut.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2009" && myURL.selectedIndex == 1 && radioBtnGroup.selectedValue == 0)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2009'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForDirEmp.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2009" && myURL.selectedIndex == 1 && radioBtnGroup.selectedValue == 1)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2009'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForTotImpEmp.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2009" && myURL.selectedIndex == 2 && radioBtnGroup.selectedValue == 0)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2009'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForDirLabInc.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2009" && myURL.selectedIndex == 2 && radioBtnGroup.selectedValue == 1)
fLayer.definitionExpression = "DATA_YEAR_TXT like '2009'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForTotImpLabInc.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
if (yearcombo.selectedItem.year == "2009" && myURL.selectedIndex == 3 )
fLayer.definitionExpression = "DATA_YEAR_TXT like '2009'"
var graphic:Graphic = Graphic(event.currentTarget);
graphic.symbol = mouseOverSymbol;
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
try{
textArea.htmlText = myURL.selectedItem.label + graphic.attributes.ForIndirBusTax.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));}
catch(error:Error) {
trace("Caught Error: "+error);
public function onMouseOutHandler(event:MouseEvent):void
var gr:Graphic = Graphic(event.target);
gr.symbol = defaultsym;
myMap.infoWindow.hide();
]]>
</fx:Script>
<fx:Style>
@namespace esri "http://www.esri.com/2008/ags";
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@namespace esri "http://www.esri.com/2008/ags";
@namespace components "com.esri.ags.components.*";
components|InfoWindow
content-background-alpha : 0.4;
background-color : #4A7138;
background-alpha : 0.7;
border-style : solid;
</fx:Style>
<mx:HBox width="930" height="800" id="mapHbox" horizontalAlign="center" >
<mx:HBox width="80">
</mx:HBox>
<mx:HBox id="myHBox" width="800" height="600" backgroundColor="0xffffff" >
<mx:VBox height="590" width="358" >
<!-- <mx:Panel
width="356" height="100%"
color="0x000000"
borderAlpha="0.15"
>
-->
<mx:Canvas height="100%" width="100%" backgroundColor="0xffffff" >
<esri:Map id="myMap" openHandCursorVisible="false"
height="100%"
logoVisible="false"
doubleClickZoomEnabled="false"
scrollWheelZoomEnabled="false"
zoomSliderVisible="false"
scaleBarVisible="false" scale="4000000" >
<esri:extent>
<esri:Extent xmin="-10736651.061900" ymin="4024099.909700" xmax="-10409195.669800" ymax="3440153.831100" >
<esri:SpatialReference wkid="102100"/>
</esri:Extent>
</esri:extent>
<esri:ArcGISDynamicMapServiceLayer id="dynamicLayer2"
url="http://tfs-24279/ArcGIS/rest/services/RADIO_BUTTONS/counties_layer/MapServer" />
<esri:ArcGISDynamicMapServiceLayer id="dynamicLayer" name=" "
alpha="1"
load="loadLayerName()"
url="http://tfs-24279/ArcGIS/rest/services/{myURL.selectedItem.value}/MapServer" />
<esri:FeatureLayer id="fLayer"
graphicAdd="fLayer_graphicAddHandler(event)"
mode="snapshot"
outFields="*"
symbol="{defaultsym}"
url= "http://tfs-24279/ArcGIS/rest/services/RADIO_BUTTONS/feature_layer_0709_five/FeatureServer/ 0" />
</esri:Map>
</mx:Canvas>
<!-- </mx:Panel>-->
</mx:VBox>
<mx:VBox height="590" width="20" >
</mx:VBox>
<mx:Canvas height="500" width="400" backgroundColor="0xffffff"
horizontalScrollPolicy="off"
verticalScrollPolicy="off" >
<mx:VBox width="420" height="50%" paddingLeft="5" paddingTop="10" paddingRight="10" paddingBottom="10"
verticalGap="8">
<mx:Form >
<mx:FormItem label="Year :" >
<mx:ComboBox id="yearcombo" selectedIndex="0" labelField="label" width="100%" change="changeEvt(event)" >
<mx:ArrayCollection id="year" >
<fx:Object label="2007" year="2007" />
<fx:Object label="2009" year="2009" />
</mx:ArrayCollection>
</mx:ComboBox>
</mx:FormItem>
<mx:FormItem label="Measure:">
<mx:ComboBox id="myURL" selectedIndex="8" width="80%" mouseOver="clickEv2(event)" close="closeHandler(event)">
<mx:ArrayCollection id="measures" >
<fx:Object id="forindout07" labeltext="Forestry Industry Output" label="Forestry Industry Output " value="RADIO_BUTTONS/TFEI_07_forest_industry_output" year="2007" />
<fx:Object id="foremp07" label="Forestry Employment " value="RADIO_BUTTONS/TFEI_07_forest_employment" year="2007" />
<fx:Object id="forlabinc07" label="Forestry Labor Income " value="RADIO_BUTTONS/TFEI_07_forest_labincome" year="2007" />
<fx:Object id="forindbustax07" label="Forestry Indirect Business Tax" value="RADIO_BUTTONS/TFEI_07_forest_business_tax" year="2007" />
<fx:Object id="forindout09" label="Forestry Industry Output " value="RADIO_BUTTONS/TFEI_09_forest_industry_output" year="2009" />
<fx:Object id="foremp09" label="Forestry Employment " value="RADIO_BUTTONS/TFEI_09_forest_employment" year="2009" />
<fx:Object id="forlabinc09" label="Forestry Labor Income " value="RADIO_BUTTONS/TFEI_09_forest_labincome" year="2009" />
<fx:Object id="forindbustax09" label="Forestry Indirect Business Tax" value="RADIO_BUTTONS/TFEI_09_forest_business_tax" year="2009" />
<fx:Object id="blank" label=" " />
</mx:ArrayCollection>
</mx:ComboBox>
</mx:FormItem>
</mx:Form>
<mx:VBox id="layerPanel" width="50%" height="8%" verticalGap="3" paddingLeft="17">
<mx:RadioButtonGroup id="radioBtnGroup" itemClick="radioClickHandler(event)" />
</mx:VBox>
<mx:VBox paddingLeft="17" height="50%" >
<mx:Canvas id="legendPanel" width="100%" >
<mx:Label id="myLabel" text=" " fontWeight="bold" />
<esri:Legend id="myLegend"
layers="{[dynamicLayer]}"
map="{myMap}" visible="false"
respectCurrentMapScale="false"/>
</mx:Canvas>
<mx:TextArea width="275" borderAlpha="0" height="200" >
<mx:htmlText >
<![CDATA[<font size='11'><b>Note:</b> Counties in white indicate either no data is available for that measure or the data has been supressed due to confidentiality.</font>
]]>
</mx:htmlText>
</mx:TextArea>
</mx:VBox>
</mx:VBox>
</mx:Canvas>
</mx:HBox>
</mx:HBox>
</mx:Application>
Similar Messages
-
I'm trying to get the count for each row to total count for each month
Something like this
Hardware | Jan
Monitors | 5
Processors | 137
Printers | 57
etc........
How can I write a query for this. I can get the Hardware column but don't know how to get the next column.If you can provide more data like sample input DML statements it would have been wonderful..
Assuming is , you need a pivot. Here is an article on basic Pivot..
http://sqlsaga.com/sql-server/how-to-use-pivot-to-transform-rows-into-columns-in-sql-server/
something like this may be..
DECLARE @Input TABLE
Hardware VARCHAR(20),
[Date] VARCHAR(20)
INSERT INTO @Input VALUES('Monitor', '01/01/2014'), ('CPU', '01/01/2014'), ('Monitor', '01/03/2014')
, ('ABC', '01/01/2014'),('Monitor', '02/01/2014')
;WITH CTE AS
SELECT Hardware, LEFT(DATENAME(M, [Date]),3) AS [MonthName] FROM @Input
SELECT *
FROM
SELECT Hardware, [MonthName], COUNT(Hardware) AS Count FROM CTE GROUP BY Hardware, [MonthName]) a
PIVOT (MAX([Count]) FOR [MonthName] IN ([Jan], [Feb])) pvt
Please mark as answer, if this has helped you solve the issue.
Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles. -
Hi,
I need to get the details for each user hit.
Apparently, this table has the IMPRESSIONS column which returns the total number of hitcounts and VISITS which counts the number of unique user who accesses the portal. What I am trying to look for is to get all the details per hitcount. I need to find out how many time a specific user accessed a specific page or iview.
I also used the table WCR_USERPAGEUSAGE, which I get the information of the users counted in the VISITS column in the first table.
I could not get the specific user per hit.
Please enlighten me if this is possible and how to do this?
Thanks!Hi Catherine,
Why not use the portal activity report iView?
In the portal activity report iView the 3rd option allows you to choose a page for example and see
the user who accessed it and how many times.
Thanks and BR,
Saar -
Get the index of each item in a liquid for loop
If I'm looping through a collection with a for statement, is there a way to output the index value of each item as well.
Similar to how we have {tag_counter} in regular BC webapps, but I'd like to get the index value of any collection data.
for example:
{% for item in myCollection %}
1. {{item.name}}
{% endfor %}
But I want the "1." to be the actual index of the item in the object/array.
In the docs there is a filter called 'size' which may do the job but I don't know how to use it as there is no example shown.Thanks for pointing me in the right direction Liam.
As I noted in the question, I am using the docs, but these docs can be a little overwhelming when first exploring them (which I am).
There are many sections where things could be in and often I'm not entirely sure what I need to look under... case in point - I would not have thought rendering the index value would be under 'Logic Tags'.
Additionally, the docs have broken links, pages fail to load and they are littered with typos and missing info.
Don't get me wrong, I'm very grateful of the docs and they are a great resource, but please don't assume everything is easy if it's documented. Some of us are still learning and are not as familiar with the docs as yourself. I spent a lot of time searching the docs and trying to crack this myself before posting here. -
How to get the index for itemrenders
I have an itemrender with a button. I'd like to disable the button for the first and last object in my itemrenderer (list). Can any provide a simple example how to accomplish this task?
Thanks for your assistance.Hi madhooper,
You can try this way..make use of Boolean variable..
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var initDG:ArrayCollection = new ArrayCollection([
{Artist:'Pavement1', Album:'Slanted and Enchanted', Price:11.99, IsEnabled:false},
{Artist:'Pavement2', Album:'Brighten the Corners', Price:178.99, IsEnabled:true},
{Artist:'Pavement3', Album:'Enlighten the Corners', Price:174.99, IsEnabled:true},
{Artist:'Pavement4', Album:'Borade the Corners', Price:431.99, IsEnabled:true},
{Artist:'Pavement5', Album:'Corners of Edges', Price:221.99, IsEnabled:true},
{Artist:'Pavement6', Album:'Maniacal Palace', Price:32.99, IsEnabled:false}
]]>
</mx:Script>
<mx:Panel paddingTop="10" paddingBottom="10"
paddingLeft="10" paddingRight="10">
<mx:DataGrid id="myGrid" dataProvider="{initDG}"
width="100%" editable="true">
<mx:columns>
<mx:DataGridColumn dataField="Artist" resizable="true"/>
<mx:DataGridColumn dataField="Album" resizable="true"/>
<mx:DataGridColumn dataField="Price" resizable="true"/>
<mx:DataGridColumn editable="false">
<mx:itemRenderer>
<mx:Component>
<mx:Button enabled="{data.IsEnabled}" label="Edit" />
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
</mx:Application>
Thanks,
Bhasker -
How to get the values from xml file to java combo box
Hi frens,
I am new to java and xml programming,
Now, i want to have a code of getting the tag values from the xml file
into the swing combo box of java front end.
How can we do that?
any help of code or tutorial or an ebook is a great help for me.
Thank you,
Karthik.
Edited by: Karthik84 on Aug 27, 2008 1:49 AM
Edited by: Karthik84 on Aug 27, 2008 11:29 PMlook at this link
http://www.stylusstudio.com/docs/v2006/d_help30.html
I read sometime back that castor has a tool to do
conversion. You might have a look into casto as well. -
How to get the texts for each line item for Sales order in a smartform
I'm createing a smart form in which i need to display certain texts for each line item of a sales order. How can i get those??
I'm trying with the table STXH and FM read_text... but i'm not clear how and what i'm getting... can anybody pls help me.....Hi There,
But then i will be getting only the value. i want to link that against the particular material of the Purchase Order.
Like for ex:
PO No. Material Code Line Item Basic Excise Tax Inv Value
0000001 5000251 010 100 16 4.64 120.64
0000001 5000252 020 200 32 9.28 241.28
Can u help me on this?
Regards,
Jitesh -
Function to get the Agents for the Workitem not the possible agents
Hi Guys ,
To get the user for each scienario we saved it in the ztable. Now i want to show in report the list possible agents assigned to workitem. ts should agents asigned to it ... its can be four or five ....Try to make use of the FM SAP_WAPI_GET_WI_AGENTS, if at all you want to know the agents with respect to a workitem
and
check the below too
SWL_WI_DISP_ACTUAL_AGENTS
SWL_WI_DISP_EXCLUDED_AGENTS
SWL_WI_DISP_POSSIBLE_AGENTS -
Looping through javabean array in jsp?
Hello,
In my servlet, I created an ArrayList of objects and pass these to a jsp page using:
req.setAttribute("bean", uploadList);
The ArrayList contains objects of the FileBean class, with a getIndex, and getDate methods.
Could any possibly demonstrate how to loop through the ArrayList in the jsp and display the FileBean object values in a html table?
To display the values of a javabean in jsp pages I normally have to use for example, requestScope.bean.getMethod();
ThanksNo, that would be requestScope.bean.attributename, if your getter method has the same name as the attribute you are getting.
To loop through an array you have to use the c:forEach tag. Check google for "jstl foreach example", there are loads of examples. -
How to get the index of selected values in SelectManyChoice...
How to get the index of selected values in SelectManyChoice... the value which i get is coming when i submit the value second time
By using the given code i get the value of the selected indices, but problem here is i get the value when it get submits at the second time... First time the length of that int array is 0.
Second time it shows the value two times (i.e) First time submitted value and the second time submitted value. After that it works fine.. I have problem while clicking first time only..
The Following error also raises.. One multiselect is dependent on other multiselect.
DF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase PROCESS_VALIDATIONS 3
java.lang.ArrayIndexOutOfBoundsException: 6
at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.findObjectFromIndex(FacesCtrlListBinding.java:334)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.getInputValue(FacesCtrlListBinding.java:199)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.internalGet(JUCtrlValueBinding.java:2416)
at oracle.jbo.uicli.binding.JUCtrlListBinding.internalGet(JUCtrlListBinding.java:3717)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.internalGet(FacesCtrlListBinding.java:500)
at oracle.adf.model.binding.DCControlBinding.get(DCControlBinding.java:749)
at javax.el.MapELResolver.getValue(MapELResolver.java:164)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstValue.getValue(Unknown Source)
at com.sun.el.ValueExpressionImpl.getValue(Unknown Source) -
How to get the index of table row without selection?
Hi all,
I have an table designed in XML view.Now i have added an change method for qty cell "valqty". When user inputs the qty in the cell and press enter this method is triggered now I want to know which index of the table is currently edited.Through which i can get the value of other cell in the same row.
NOTE: The table row doesn't have selection either multiple or single
I tried the following inside the valqty method but it now working
this.getValue();
this.getBindingContext().getProperty('PRD_NUM');
<Table id="idProductsTable"
inset="false"
items="{oModel>/deliverylist}"
visibleRowCount= "7"
mode="MultiSelect"
modeAnimationOn="true">
<headerToolbar>
<Toolbar>
<Label text="Products"></Label>
</Toolbar>
</headerToolbar>
<columns>
<Column
minScreenWidth="Tablet"
demandPopin="true">
<Text text="Order" />
</Column>
<Column
minScreenWidth="Tablet"
demandPopin="true">
<Text text="Quantity" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text text="{oModel>PRD_NUM}" />
<Input value="{oModel>DEL_QUAN}" change="valqty" maxLength="13" />
</cells>
</ColumnListItem>
</items>
</Table>
ThanksThanks Robin,
But in my case oEvent.getSource() is returning the cell instance and
oEvent.getSource().getBindingContext() is undefined
Hence not getting the value
I also tried the following
oEvent.getSource().getParent().getParent().indexOfItem()
But index returned is -1 -
Get the index of a specific item in a Datagrid
Is their an easy way to get the index of specific item in a datagrid. So say my DG holds ten items of type foo. I need to find the index of foo #8. Remember the foo's may not be in orde 1-8 because of sorting or something.
Do I just need to run iterate through the rows and find, which matches the object I am looking for?Thats it thanks. DG is getting refreshed so old objects don't match up to new objects so have to do it manually.
Thx. -
Getting the index of an unbounded item
Hi there,
How can i get the index of an unbounded item in an incoming record set message?
For example, suppose my message looks like this:
<Root>
<Record>item_1</Record>
<Record>item_2</Record>
<Record>Item_X</Record>
</Root>
And i want to know the index of "Item_X" while mapping
Thanks,
Yigal.Just create a UDF of type queue. The input of UDF is the node you want to access (in your example, Record).
In the code, use somehing like:
for (int i=0; i< a.length; i++) {
<insert logic here>
And inside the for loop, you can implement the desired logic, and the variable i will have the index of your node (actually it will have index - 1, since its from 0 until a.length-1 ).
Regards,
Henrique. -
How to get the index of a row in dynamically generated list
Hi,
I am displaying a list which contains 6 rows using <logic:iterator/>
If i am changing a text value which is in 3 row, I want to pass that row index to the javascript function.
I am using IndexId attribute of <logic:iterator> to get the index of a row,but
It is working fine for Hyperlink buttons, but it is no working for text boxes.
can any one plz help me..
Thanks,
madhumadhu,
Please post your code... It's a bit like asking a mechanic to fix your car blind folded. -
How to get the index of the word at current cursor position in the word?
Dear All
I am implementing a spell checker of my native language in Word. Whenever I run spell checker it start from the first word. How can I make it to start from the current cursor position? How can I get the index of the word at the current cursor position?
Thanks in advance.
Dharam Veer Sharmahi Dharam Veer Sharma,
Thanks for sharing the solultion with us.
It is helpful for others who have the same issue. And if you have any Office developing issue, please feel free to open a new thread.
Have a nice day.
Regards & Fei
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
Problem with Cyrillic fonts in Mail
I have a problem with Mail mangling Cyrillic fonts. It happens like this: 1. I create a new mail. I set my input locale to Bulgarian - Phonetic. 2. I type out the email and send it to someone (afraid I don't know their config). 3. The other person re
-
How do i change the icloud account on my iphone to a different existing account
I have a business iPhone 5S on which the iTunes account is associated with the Apple ID I signed up for using my business e-mail. I signed in to iCloud with a personal Apple ID account to get some of my personal music onto the device. I have been try
-
Itunes doesn`t read half of my id3 tags
Hi, I am stuck with a problem with itunes. In the music library, itunes only writes half of my tracks with the id3 tags. All of my songs are mp3s. Every single id3 tag of all my songs gets recognized in winamp, wmp, or in the windows file browser. Bu
-
Hi, I want to display an ALV grid/ list report with a check box at the begining of each row. I want to select some or all check boxes. Based on the selection, i need to perform some action (like z table update). Can u plz send the sample code to meet
-
Why wont my ipad connect to server, laptop fine same server
I AM HAVING PROBLEMS WITH IPAD, NOT ABLE TO LOGIN, MESSAGE FAILED TO CONNECT TO SERVER. HOW CAN I RECONNECT.