Quantcast
Channel: Forums - ArcGIS Viewer for Flex
Viewing all 2097 articles
Browse latest View live

Re: Link Widget question

$
0
0
Do you know how to close a child window for flash? If child window is closed, click the url link again then new window will open and stay focus. But can't close the child window.
1) I try a simple test use this code and it won't work:

var jscommand:String = "window.close('http://www.esri.com');";
var req:URLRequest = new URLRequest("javascript:" + jscommand + " void(0);");
navigateToURL(req, "self");

and test the javascript code here able to do the task I want but how to use it in flash?

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test Page</title>
<script type="Text/javascript">
var theChild;


function OpenWindow()
{
if(theChild!=null)
{
if(!theChild.closed)
{
theChild.close();
}
}
url='http://www.esri.com';
theChild = window.open(url, 'theChild', 'menubar=no,location=no,resizable=no,toolbar=no,scrollbars=auto');
}
</script>


</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" id="btnOpen" onclick="OpenWindow()" value="open" />
</div>
</form>
</body>
</html>

Editing DEFAULT version with Flex Viewer and topology in desktop

$
0
0
ESRI Users,

Recently I have set up an Oracle GDB, ArcGIS for Server 10.2 and ArcGIS Viewer for Flex in order to give my users read/write access to certain feature classes using internet browser. They do many edits using the Viewer so I did not registered the dataset as versioned. I did set up auto refresh parameter in feature layers in order to see edits made by other users. But apart from that we have two desktop licenses (Standard) and I want to set up topology on the dataset to give desktop users possibility to verify the data and to remove topology errors.

I want both types of users to see their edits.

Is it good idea to register the data (we use DEFAULT version) as versioned, create the topology in it and edit the topology in desktops while maintaining existing Flex Web App? Is it going to work? I suppose that desktop users would have to save edits and compress the GDB in order to move their edits to base tables, right? Web clients see and edit base tables, right?

How to achieve such hybrid solution?

Thanks,
Bart

Custom SignInWindow will not go away...?

$
0
0
I am using a custom SignInWindow---with the IdentityManager.instance.enabled = true;
, when I log in as me (the administrator with access to everything) the SignInWindow functions as it should. I enter my user name and password, press ok and I log in and the application behaves as expected.

When another user logs in the SignInWindow comes up normally and functions normally except it won't go away. When you click ok after entering the credentials the SignInWindow appears again....and again....and again.

On the Custom SignInWindow I have a button that allows public users in. Public users only have access to public information. When this button is clicked this code is fired...

//m_idManager.setCredentialForCurrentSignIn(null);
m_idManager.enabled = false;
PopUpManager.removePopUp(this);

and everything works as expected as a public user....

Why won't that SignInWindow go away after entering the correct credentials????

delete feature using applydits delete

$
0
0
Hi everyone
I have the following problem:
I have a list of features that are charged to a Datagrid, and I want to select an item and delete a feature clicking "delete".
For this I am using the method applyedits of FeatureLayer class.
the problem is that when executing the instruction to remove the objetIds are not sent in the request, I can verify that in "developers tool" window of google chrome. Anyone know why?

the parameters send to request was:
adds []
f json
updates []
but delete was not send, why?

and answer was:
{"addResults":[],"updateResults":[],"deleteResults":[]}
but delete operation was not executed, why?

attached the source code I'm using, thanks ...

Attachment 27407

<?xml version="1.0" encoding="utf-8"?>
<viewer:BaseWidget 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"
xmlns:viewer="com.esri.viewer.*">

<fx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.events.FeatureLayerEvent;
import com.esri.ags.events.LayerEvent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.layers.FeatureLayer;
import com.esri.ags.layers.GraphicsLayer;
import com.esri.ags.tasks.QueryTask;
import com.esri.ags.tasks.supportClasses.Query;
import mx.collections.*;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.events.ListEvent;
import mx.rpc.AsyncResponder;
import mx.rpc.Fault;
import mx.rpc.events.FaultEvent;

private var service:String = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0";

protected function btDelete_clickHandler(event:MouseEvent):void
{
try{
var eventsLayer:FeatureLayer = new FeatureLayer();
eventsLayer.url = service;
var gra:Graphic = dgFeatures.selectedItem.gra;
var deletes:Array = [ gra ];
eventsLayer.applyEdits([], [], deletes,
new AsyncResponder(featureLayer_editsCompleteHandler, featureLayer_faultHandler));
function featureLayer_editsCompleteHandler(event:FeatureLayerEvent):void
{
Alert.show("delete sucessfull")
}
function featureLayer_faultHandler(event:FaultEvent):void
{
Alert.show("delete failed")
}
}
catch (error:Error)
{
Alert.show("error at deleting process" + error.toString())
}
}


protected function btLoad_clickHandler(event:MouseEvent):void
{
try{
var queryTask:QueryTask = new QueryTask(service);
var query:Query = new Query();
query.where = "1=1";
query.outFields = ['*'];
query.returnGeometry = true;
queryTask.execute(query, new AsyncResponder(onResultQuery, onFaultQuery));

function onResultQuery(featureSet:FeatureSet, token:Object = null):void
{
try
{
var ac:ArrayCollection = new ArrayCollection();
var k:int;
for(k=0;k<featureSet.features.length;k++)
{
var recordGraphic:Graphic = featureSet.features[k];
ac.addItem({Id:recordGraphic.attributes["objectid"], Name:recordGraphic.attributes["req_type"], gra:recordGraphic });
}
dgFeatures.dataProvider = ac;
}
catch (error:Error)
{
Alert.show("Error processing features")
dgFeatures.dataProvider = null;
}
}

function onFaultQuery(info:Object, token:Object = null) : void
{
Alert.show("query error")
}
}
catch (error:Error)
{
Alert.show("query processing error")
}
}

]]>

</fx:Script>
<viewer:WidgetTemplate id="wTemplate" height="620" width="450">
<mx:Form fontSize="12">
<mx:FormItem horizontalAlign="center">
<s:Button id="btLoad" label="Load" click="btLoad_clickHandler(event)"/>
<mx:DataGrid id="dgFeatures" width="350" height="200" >
<mx:columns>
<mx:DataGridColumn dataField="Id" />
<mx:DataGridColumn dataField="Name" />
</mx:columns>
</mx:DataGrid>
<s:Button id="btDelete" label="Delete" click="btDelete_clickHandler(event)"/>
</mx:FormItem>
</mx:Form>
</viewer:WidgetTemplate>
</viewer:BaseWidget>
Attached Thumbnails
Click image for larger version

Name:	delete feature.png‎
Views:	N/A
Size:	109.4 KB
ID:	27407  

Flex Viewer 3.4 Search Widget Error

$
0
0
I'm using ArcGIS Viewer for Flex3.4. This search worked in previous versions but now it does not.
I've look at everything I can think and I'm still receiving the following error when running the search:
[RPC Fault faultString="Invalid or missing input parameters." faultCode="400" faultDetail=""]
I'm sure I'm overlooking something simple but I can't see it.
I have other searches against string fields working on the same feature class/rest point. The only difference with this search is that the field is a integer type:

DRAINAGEBASIN ( type: esriFieldTypeInteger , alias: Drainage Basin , Range: [-1, 999] )

Here is the search:
<name>Drainage Basin GM</name>
<url>URL LEFT OUT ON PURPOSE</url>
<expression>DRAINAGEBASIN = '[value]'</expression>
<textsearchlabel>Drainage Basin (example: 453) =</textsearchlabel>
<titlefield>FACILITYID</titlefield>
<fields>
<field name="FACILITYID" alias="Facility ID"/>
<field name="SUBTYPE" alias="Subtype"/>
<field name="YEARINSTALLED" alias="Year Installed"/>
<field name="STATUS" alias="Status"/>
<field name="POSITIONALACCURACY" alias="Positional Accuracy"/>
<field name="DiameterFix" alias="Diameter (in.)"/>
<field name="MATERIAL" alias="Material"/>
<field name="SIZEDIMENSIONRATIO" alias="Size Dimension Ratio"/>
<field name="RECORDEDLENGTH" alias="Recorded Length (FT)"/>
<field name="UPSTREAMINVERT" alias="Upstream Invert (FT)"/>
<field name="DOWNSTREAMINVERT" alias="Downstream Invert (FT)"/>
<field name="SLOPE" alias="Slope (%)"/>
<field name="DRAINAGEBASIN" alias="Drainage Basin"/>
<field name="LINING" alias="Has a lining?"/>
<field name="INSTALLEDCOST" alias="Installed Cost (LF)"/>
<field name="GRAVITYINSPECTION" alias="TV Inspection"/>
<field name="COMMENTS" alias="Comments"/>
<field name="SOURCEDATA" alias="Source Data"/>
<field name="HYPERLINK" alias="Record Drawing"/>
<field name="VIDEOINSPECTIONDATE" alias="Video Inspection Date"/>
<field name="VIEWCENTER_ID" alias="VIEWCENTER_ID"/>
<field name="VERTICAL_DATUM" alias="Vertical Datum"/>
<field name="CASING" alias="Casing?"/>
<field name="SHAPE.len" alias="SHAPE.len"/>
</fields>
<orderbyfields>FACILITYID ASC</orderbyfields>

Any help would be greatly appreciated.
I'm thinking about creating a string field and copying the data (drainage basin values) over to it.

LiveMap default layers

$
0
0
Hi, I have a LiveMaps Widget that loads many layers from a map service, with the visibility of layers already defined. The problem is, when I disabled/uncheck all layers inside a GroupLayer in the LiveMaps widget, all the default layers become visible again, that's not suppose to happen(all checkboxes are unmarked), and I have to uncheck the GroupLayer to these layers become off, otherwise the default visibility will prevail. Is this problem something related to the map service? or is it something that I need to configurate via code?

Editing strange behavior

$
0
0
I'm using arcgis viewer for flex 3.4 and when I edit features they were sometimes saved shifted. This occurs when I zoom or pan on map during editing operation.

Add extra button for popup infowindow

$
0
0
I didn't find PopUpRendererSkin.mxml under ~\src\com\esri\ags\skins folder. So where is the file on FlexViewer 3.4? I need to create a extra button to open a widget on popup infowindow. So do I need to create a new file for PopUpRendererSkin.mxml under ~\src\com\esri\ags\skins folder? Thanks.

ArcGIS viewer for flex search widget

$
0
0
Can you search multiple attributes in the same search example: ADDFULL LIKE ('%[value]%') OR HSENO LIKE '[value]' in the out of the box search widget for flex viewer 3.4?

Chart and AttributeTable widgets conflict?

$
0
0
Hello All,

I made a map with several layers and add the attributeTable widget. It was working fine.
But then I add the Chart widget.
When I select (geographycally) the polygons I want to see in the chart:
- the polygons are not highlighted
- the attribute table is not updated (or no new tab appears)
(but the chartWidget itself works)

The configuration in config.xml is:

<layer type="dynamic" label="Baseline Findings" url="my adress">

The configuration in the AttributeTableWidget.xml is:
<layersettings>
<layer name="Assessed Households Group" url="my adress/1">

<fields>
<field name="reach_SSD.SDE.SSD_AST_BRACE_GIS_FCS.County" alias="County"/>
<field name="reach_SSD.SDE.SSD_AST_BRACE_GIS_FCS.State" alias="State"/>
<field name="reach_SSD.SDE.SSD_AST_BRACE_GIS_FCS.Total_HH" alias="Total HH"/>
<field name="reach_SSD.SDE.SSD_AST_BRACE_GIS_FCS.Control_TotalHH" alias="Control TotalHH"/>
<field name="reach_SSD.SDE.SSD_AST_BRACE_GIS_FCS.Treatment_TotalHH" alias="Treatment TotalHH"/>
</fields>
<showobjectid>false</showobjectid>
<showglobalid>false</showglobalid>
<exportlocation>false</exportlocation>
<showattachments>false</showattachments>
<showrelatedrecords>false</showrelatedrecords>
<columnsorder>fields</columnsorder>
</layer>
</layersettings>


And the configuration in ChartWidget.xml is:
<layer label="Assessed Households Group" url="http://reach1.cern.ch/arcgis/rest/services/SSD_BRACE/SSD_AST_BRACE_results/MapServer/1" >
<labelfield>reach_SSD.SDE.SSD_AST_BRACE_GIS_FCS.County</labelfield>
<fields>
<field alias="State" name="reach_SSD.SDE.SS_3_Counties.STATE"/>
<field label="County" name="reach_SSD.SDE.SSD_AST_BRACE_GIS_FCS.County"/>
<field label="Total HH" name="reach_SSD.SDE.SSD_AST_BRACE_GIS_FCS.Total_HH"/>
<field label="Treatment" alias="Treatment" name="reach_SSD.SDE.SSD_AST_BRACE_GIS_FCS.Treatment_TotalHH"/>
<field label="Control" name="reach_SSD.SDE.SSD_AST_BRACE_GIS_FCS.Control_TotalHH"/>
</fields>
<medias>
<media caption="You selected {=COUNT} counties"
chartfields="reach_SSD.SDE.SSD_AST_BRACE_GIS_FCS.Total_HH"
title="Total No of Households"
type="columnchart"/>

</medias>
</layer>

Is there a problem in this configuration, or a conflict between the 2 widgets?
Hope I'm clear
Thanks
Renaud

Label Option Wizard

FlexViewer Attribute Table - Tab for 'All Features''

$
0
0
The functionality available in 3.4 to interact with the layer list and attribute table are great, however has anyone found a way to include a tab for 'All Features'? Grouped layers can of course be used to turn a tree of information on or off simultaneously, but this is only reflected in the attribute table at individual layer level. Is this functionality available within the viewer or is this a custom job? Any advice appreciated?

Call a function on eSearch from a popup button click

$
0
0
I created an extra button on popup infowindow (PopUpRendererSkin.mxml). How do you call a getLocateGra() function on eSearch when user click a button on popup infowindow instead of click the icon on eSearch widget?

Thanks.
Attached Images
 

Limit number of ESRI Basemaps to use

$
0
0
I am using the ESRI Basemaps in the default 3.4 viewer. I am not using the App Builder.

Is there a way to limit the number of Basemaps that are seen under the Basemap Tab? the default shows 9 basemaps (Imagery, Streets, Imagery with Labels, Topography, etc...), all I want to do is show Imagery and Streets. Is this possible? if yes, please tell me where to modify the code to do so. thanks.

Zoom Tool does not work in 3.4

$
0
0
When I try to use the Zoom In Tool on the Zoom Bar at the left side of the Map Window it does not activate. The Zoom Slider Bar work good. But, the icon under it with the "+" Magnifying Glass does not.

It worked fine in 3.0.

Any ideas?
Attached Thumbnails
Click image for larger version

Name:	MICE_Zoom_Tool_Problem.jpg‎
Views:	N/A
Size:	141.6 KB
ID:	27549  

Search Widget - Search By Attribute 3.4

$
0
0
So I just updated to 3.4 and according to the help. The search widget should now, have the option to search by attribute. But I am not seeing it in my applications. Any ideas on how I can make this work? What I am doing wrong?
Thanks.

From related records to the object in the map?

$
0
0
Hi everyone,

I have a dynamic feature service. There is one layer (feature class) that is related to a table.
Using the flex viewer I created an application, where I can query the layer and get the related records.

I would like to query, first the related records, and then go to the related feature. For example search for an owner name, select one owner from the results list and then zoom to the related parcel.

Can this be done with a widget?

Thank you,

Question for applyBuffer() & getLocateGra() function on eSearch?

$
0
0
Currently when apply buffer function, I have to click the special button on graphical search view(getLocateGra function) to search a layer based on graphic from eLocate widget then click apply buffer icon(applyBuffer function) on spatial view.
Is there possible to combine two function? Therefore you only need one icon instead of two icons. I modified code below but still have to click two time on the same icon in order to apply buffer after get search layer result.
public function getLocateGra():void
{
if(locateGraphicsLayer){
var geom:Geometry
var graLayAC:ArrayCollection = locateGraphicsLayer.graphicProvider as ArrayCollection;
if (graLayAC.length > 1){
geom = unionGeoms2(locateGraphicsLayer);
queryFeaturesGraphical(geom, "esriSpatialRelIntersects", configSearchGraphical[(cboLayerGraphical.selectedIndex<0)?0:cboLayerGraphical.selectedIndex]);
applyBuffer(); // new add
}else if (graLayAC.length == 1){
geom = (graLayAC[0] as Graphic).geometry;
queryFeaturesGraphical(geom, "esriSpatialRelIntersects", configSearchGraphical[(cboLayerGraphical.selectedIndex<0)?0:cboLayerGraphical.selectedIndex]);
applyBuffer(); // new add
}else if(locateGraphicsLayer.graphicProvider.length == 0){
showStateResults();
showMessage("There are no graphics available",false);
}
}else{
showStateResults();
showMessage("There are no graphics available",false);
}
}


Thank you.

How to make geocoder pop up a graphic symbol instead of an InfoWindow?

$
0
0
Hello,

I have been working inside the GeocoderComponent.mxml to try and change how the InfoWindow looks when it is displayed, so as to not hide the important features the map is displaying. Changing the content alpha didn't look good enough. My other thoughts were to figure out a way to hide the infoWindow after a short period of time (maybe 5 seconds?) or to drop the infoWindow altogether and only display a symbol like a pin. The address entered is not important information, and therefore does not need to take up a bunch of the map's viewing space in the infoWindow.

Does anyone have an idea on how to either hide the infoWindow after a short delay, or make it so that a narrow symbol is displayed that doesn't take up much space, instead of an infoWindow?


This is the function I have been working with, and I believe it would be the right place to add an infoWindow.hide() after a few seconds, I'm just not sure how to do that.
Code:

            private function infoWindowShow(point:MapPoint):void
            {
                map.infoWindow.content = popUpRenderer;
                map.infoWindow.contentOwner = popUpRenderer.graphic;
                map.infoWindow.show(point);
            }

As for showing a symbol instead of an infoWindow, I think that involves a graphicLayer (??) and again I'm not sure where to incorporate that. Any info is greatly appreciated!


Thanks,

David

Can ArcGIS Viewer for Flex be used offline utilizing local data?

$
0
0
This might seem like a silly question....but is it possible to setup ArcGIS Viewer for Flex (or any flex web application) to look at local data (i.e. shapefile or file geodatabase) instead of web services? Thanks!
Viewing all 2097 articles
Browse latest View live