|
POST
|
I created a little test app, which creates programmatically some radion buttons and buttons, loads a tiled map + feature layer, and shows a legend. Nothing fancy. All works fine in Chrome and Firefox. In IE8 if the Browser History settings are set to "Automatically" to Check for newer versions of the stored pages, the pages load correctly only if I clear the cache. And they do not load correctly after that if I click the refresh browser button or Ctrl+F5. When I debug using the Developer Tools, on a refresh the modules don't load, and the function creating the buttons and the map don't execute. If I change the Browser History settings to "Every time I visit the webpage", it works fine, and if I refresh the pages they load correctly. Attached is my little test project. Hope, someone will have some time to let me know what I am doing wrong. Just learning the AMD loader now, so I might be messing up something. If you have had the same problem and have found a solution, please, advice! Thank you!
... View more
03-11-2014
08:53 AM
|
0
|
8
|
1829
|
|
POST
|
Hi guys, I would like to confirm that I am also experiencing the spinning circle problem - with Firefox 17 and now Firefox 20.0.1. 😞
... View more
04-22-2013
10:18 AM
|
0
|
0
|
677
|
|
POST
|
Tim and Roy, It looks like you might be experiencing the "Sleepy services" issue, and it has nothing to do with JSAPI if you are using ArcGIS Server 9.3.x or 10.0. This is more of a IIS behavior where default setting of an Application Pool on IIS is to recycle after 20 min of applications running under that pool being idle. Then when a user calls the services for a first time, it takes some time for the services to "wake up". And sometimes it requires a page refresh or a few for the services to load. You can try to fix this by setting the Idle Time-out for the application pool to a higher number than 20 min (if there are times when the applications are not used for 4 hours for example, you can set the timeout to 240+ minutes). Also look at any other application pool recycling settings that might be causing the pool to shut down. To make sure you modify the appropriate application pool, find out under what application pool are the ArcGIS\rest and ArcGIS\services applications running. Please, consult your IIS administrator before you make the changes, as there are situations when they are not applicable (see articles above and search on your own more). http://bradkingsley.com/iis7-application-pool-idle-time-out-settings/ http://technet.microsoft.com/en-us/library/cc771956(v=ws.10).aspx Good Luck!
... View more
04-22-2013
08:18 AM
|
0
|
0
|
1794
|
|
POST
|
Hello everybody, Here is what I want to do: - select data from a SQL Server database, which is not SDE using pyodbc - insert the records returned by the select into a table in a geodatabase I am getting the following error: *********************************************** Traceback (most recent call last): File "E:\Workspace\Warehouse\PythonScripts\PerformSpatialJoins.py", line 80, in <module> arcpyRow.YCoord = row.YCoord File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\_base.py", line 35, in __setattr__ return setattr(self._arc_object, attr, ao) ValueError: Row: Invalid input value for setting *********************************************** I understand that it doesn't like the value of the XCoord, but I don't understand why it doesn't like it. The data type of the XCoord in the SQL Server table is "numeric", and the data type of the XCoord in the geodatabase table is "double". I also tried float and long integer (the coordinates are integer values even if they are in a numeric field). I always get this error. If I don't insert the XCoord and YCoord attributes, the script works as expected. Any idea is greatly appreciated! Below is the python script: # Import arcpy module import arcpy import pyodbc import os # Set Geoprocessing environments arcpy.env.overwriteOutput = True DatabaseConnectionString = "Driver={SQL Server Native Client 10.0};SERVER=myserver;DATABASE=mydatabase;Trusted_Connection=yes" LocationsForGISProcessing = "dbo.vw_myview" ScratchGeodatabasePath = "E:\\Workspace\\Warehouse\\ScratchWorkspace\\Scratch.gdb" TempLocationsForGISProcessing = "LocationsForGISProcessing" ##################################################################################### # Create ODBC connection conn = pyodbc.connect(DatabaseConnectionString) cursor = conn.cursor() print "Connected to database" ################################################################################## # Insert the data into the geodatabase TempTable = ScratchGeodatabasePath + "\\" + TempLocationsForGISProcessing # Process: Delete Rows From Previous Load arcpy.DeleteRows_management(TempTable) arcpyCursor = arcpy.InsertCursor(TempTable) cursor.execute("SELECT * FROM " + LocationsForGISProcessing) rows = cursor.fetchall() for row in rows: arcpyRow = arcpyCursor.newRow() arcpyRow.Location_Key = row.Location_Key arcpyRow.From_Date = row.From_Date arcpyRow.XCoord = row.XCoord arcpyRow.YCoord = row.YCoord arcpyCursor.insertRow(arcpyRow) # Delete the arcypy cursor del arcpyCursor # Close the connection if (cursor is not None): cursor.close() del cursor if (conn is not None): conn.close() del conn
... View more
11-01-2012
01:17 PM
|
0
|
3
|
2024
|
|
POST
|
Gregg, I am not on version 3 yet. I looked at the source code of the FeatureDataGrid for my and your version and the Date and Coded Values Domain are handled differently. If I find some time to install 3 in the next few days, I will try to figure out why the dates and coded values domains are not coming through.
... View more
10-26-2012
10:56 AM
|
0
|
0
|
3363
|
|
POST
|
Gregg, I didn't realize you are missing the coded values domain and date for all the records. What version of the API are you using?
... View more
10-26-2012
09:07 AM
|
0
|
0
|
3363
|
|
POST
|
Gregg, I tested the code with a HyperlinkButton (added another "case") and a DataGrid, and it exports the hyperlink content to Excel. So, it could be something little that needs to change. Can you add a break point at the line "if (innerControl.GetType().FullName)" and debug to see if innerControl is null? And if it is not what values you get for path and att?
... View more
10-25-2012
10:54 AM
|
0
|
0
|
3363
|
|
POST
|
Gregg, The date and coded values domain are not exporting because they are inside templated columns. The date field is displayed via a DatePicker and the coded values domain is displayed via a ComboBox. The GetValue method in the DataGridExtension class does not handle these. I modified the GetValue method to deal with templated columns and the controls used in your scenario. I don't have a sample like this one set up, so I have not tested, and I haven't looked at the FeatureDataGrid ControlTemplate to confirm my assumptions are correct. I expect the code to not handle something right. But hope it will give you an idea of how to resolve the problem.
private static string GetValue(DataGridColumn col, Graphic graphic)
{
string path = string.Empty;
if (col is DataGridBoundColumn)
{
DataGridBoundColumn column = col as DataGridBoundColumn;
if ((column.Binding != null) && (column.Binding.Path != null))
{
path = column.Binding.Path.Path;
}
}
else if (col is DataGridTemplateColumn)
{
Control innerControl = ((DataGridTemplateColumn)col).CellEditingTemplate.LoadContent() as Control;
if (innerControl != null)
{
switch (innerControl.GetType().FullName)
{
case "System.Windows.Controls.ComboBox":
path = ((ComboBox)innerControl).GetBindingExpression(ComboBox.SelectedItemProperty).ParentBinding.Path.Path.ToString();
break;
case "System.Windows.Controls.DatePicker":
path = ((DatePicker)innerControl).GetBindingExpression(DatePicker.SelectedDateProperty).ParentBinding.Path.Path.ToString();
break;
}
}
}
if (!string.IsNullOrEmpty(path))
{
var att = Regex.Replace(path, ".*\\[(.*)\\]", "$1");
return graphic.Attributes[att] == null ? string.Empty : graphic.Attributes[att].ToString();
}
return string.Empty;
}
Good Luck!
... View more
10-24-2012
07:15 AM
|
0
|
0
|
3363
|
|
POST
|
Dominique, thanks for the solution! 😄 I think Gregg is getting the error when the attribute object is null (see image). Greg, something like this should fix the problem (make sure you are using the new GetValue method that Dominique provided): private static string GetValue(DataGridColumn col, Graphic graphic) { if (col is DataGridBoundColumn) { var path = (col as DataGridBoundColumn).Binding.Path.Path; var att = Regex.Replace(path, ".*\\[(.*)\\]", "$1"); return graphic.Attributes[att] == null ? string.Empty : graphic.Attributes[att].ToString(); } return string.Empty; }
... View more
09-28-2012
10:36 AM
|
0
|
0
|
8978
|
|
POST
|
Gregg, When you write your post, you will see a set of toolbars on the top. Hover over each tool to see what it does. To post C# code, use the "#" tool. You will see the CODE tag. Paste your code in between the opening and closing tag. That's all. Dominique is great! He is probably already looking into this. 😉
... View more
09-27-2012
06:04 AM
|
0
|
0
|
3613
|
|
POST
|
Gregg, Here is my version of that portion of the code (Not as clean and elegant as yours, but works for me. Feel free to modify it and make it better using Linq if you would like. But this is the idea. ;-)) :
foreach (Graphic data in dGrid.ItemsSource)
{
lstFields.Clear();
foreach (DataGridColumn col in dGrid.Columns)
{
string tempString = null;
if (col is DataGridTextColumn)
{
tempString = ((DataGridTextColumn)col).Binding.Path.Path.ToString();
}
else if (col is DataGridTemplateColumn)
{
//This is the case when the column has a hyperlink in the cell template
HyperlinkButton innerControl = ((DataGridTemplateColumn)col).CellTemplate.LoadContent() as HyperlinkButton;
if (innerControl != null)
tempString = innerControl.GetBindingExpression(HyperlinkButton.ContentProperty).ParentBinding.Path.Path.ToString();
else
tempString = string.Empty;
}
string attributeName = tempString.Replace("Attributes[", "").Replace("]", "");
string strValue = string.Empty;
if (excludedColumns != null)
{
foreach (string columnName in excludedColumns)
{
if (col.Header.ToString() == columnName)
{
continue;
}
else
{
if (data.Attributes[attributeName] != null)
strValue = data.Attributes[attributeName].ToString();
lstFields.Add(FormatField(strValue, strFormat));
}
}
}
else
{
if (data.Attributes[attributeName] != null)
strValue = data.Attributes[attributeName].ToString();
lstFields.Add(FormatField(strValue, strFormat));
}
}
BuildStringOfRow(strBuilder, lstFields, strFormat);
}
Good Luck!
... View more
09-26-2012
12:26 PM
|
0
|
0
|
3613
|
|
POST
|
Mathew, Thanks for the tips! I haven't done a lot of Python but if in the Python script the database connections is done with an .odc file configured to use an account with SQL Server authentication, it shouldn't use Windows Authentication with the account running the script. I am either missing something, or it just doesn't work for some reason. I will bug ESRI support on this one, and will post back the results. 😉
... View more
07-31-2012
09:23 AM
|
0
|
0
|
3342
|
|
POST
|
Mathew, Thank you for your reply! After looking at the log files of the SQL Server where the data is, we figured out that the Python script is trying to login to SQL Server using the SQL Server Agent account of the server where the job is running. And it was failing. For testing we added that account in the admin group on the server with the data, and added it as a login to SQL Server, but we didn't give it the appropriate permissions. Now, finally Python gave an error saying that the dataset doesn't exist. Why is it trying to connect using this account, when the .odc file is specifying a different user (sql server user with a password using a SQL Server authentication)? And now I know that when it is succeeding running through the Python IDLE, it is using my account to connect to the database. And I have admin rights on both servers. That's why it was succeeding. The question now is: How to set up and use in Python script an .odc connection which uses a SQL Server user account with password? I did it through ArcCatalog, selected "Allow saving password", provided password, and then copied the .odc file to a folder where the script can access it. But it obviously is using Windows authentication. What am I doing wrong?
... View more
07-31-2012
08:20 AM
|
0
|
0
|
3341
|
|
POST
|
Hello guys, I have a python script which geocodes data from a SQL Server database. The script uses an OLE DB connection to connect to the data, and the connection uses a SQL Server user with a password. I have created a SQL Server Agent job to run the script. When the OLE DB connection points to a database on the same server where the Python script is, the SQL Server job starts the Python script and executes it successfully. No problems here. When the OLE DB connection points to a database on a different server (not where the Python script is), the job starts the Python script (I have a log file and it shows that the first few statements are executed) and then when it has to connect to the database just hangs and does nothing. No error. Just hangs. If I run the same Python script from the IDLE, it runs successfully. I believe that the problem comes from the account running the script, which in this case is the account running the SQL Sever job. But I am not sure what I need to do to make this work. Any idea is greatly appreciated! Thank you! Darina
... View more
07-31-2012
05:28 AM
|
0
|
6
|
5229
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-08-2025 09:04 AM | |
| 1 | 05-04-2022 06:11 PM | |
| 2 | 05-05-2023 01:24 PM | |
| 1 | 02-09-2023 02:52 PM | |
| 2 | 02-15-2023 10:49 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-01-2025
01:12 PM
|