Selecting Features and Highlighting a Table

2353
19
11-20-2012 05:11 AM
GaryBarden
New Contributor III
Could someone point me in the direction of information of how to select a feature on a map and having the corrisponding record highlight on a table? I'm using ArcServer 9.3.

Thank you,

Gary Barden
0 Kudos
19 Replies
GaryBarden
New Contributor III
This is response from our IT folks on why we're using API version 2.8 and the DOJO library version 1.6.

The new version of the JavaScript API is build on a new version of the dojo library.  The dojo library went through some major changes and a lot of the work that was already done for our new app would have to be rewritten to use the new libraries.

Does that seem accurate?
0 Kudos
TracySchloss
Frequent Contributor
That makes more sense than having to do something on your servers because of a new API.  It depends too on whether or not you're trying to enhance existing code or whether you are starting from scratch.  At some point you do end up biting the bullet and start using the newer versions. Sometimes it isn't as bad as you think to make the switch; you don't know until you try.
0 Kudos
__Rich_
Occasional Contributor III
The dojo library went through some major changes and a lot of the work that was already done for our new app would have to be rewritten to use the new libraries.

Does that seem accurate?

Might seem an obvious question but:

Like what?
0 Kudos
GaryBarden
New Contributor III
The server part I was referring to was that I was told that in ArcServer 10 and older, the web server and ArcServer could be on the same machine, but with 10.1, they could not.
0 Kudos
GaryBarden
New Contributor III
Not exactly sure what changes, I was just told "major changes".
0 Kudos
GaryBarden
New Contributor III
Here's the information I was provided on the changes.

Version 3.0 of the ArcGIS API uses Dojo 1.7, which made significant changes to several parts of Dojo. Notably, the loader supports AMD and continues to support module loading with the older dojo.require style. The organization of Dojo modules has changed as well.
Referencing Objects and Properties in the esri Namespace
All code that references the esri namespace needs to run after all modules loaded. Using dojo.ready/addOnLoad (as shown in all samples) guarantees that all modules are loaded. This includes setting properties on esri.config, like a proxy URL. Error messages like "Uncaught ReferenceError: esri is not defined" or "ReferenceError: esri is not defined" are likely a result of referencing the esri object before all modules have loaded.
Explicitly Requiring Modules
In some cases, it may be required to load additional modules to maintain the same functionality in an application when migrating from a 2.x release of the ArcGIS API for JavaScript to 3.0. For instance, the InfoWindow - Custom sample uses dojo.fx.Toggler to show and hide the custom info window. Pre-Dojo 1.7, this class was loaded automatically when dojo.fx was loaded. This is not the case at 1.7 and dojo.fx.Toggler must be explicitly required. This is shown in the JavaScript that defines the custom InfoWindow module.
Configuring Dojo to Load Custom Modules
Dojo's configuration for module loading is still specified as a data-dojo-config attribute on the script tag that references dojo or with a global variable named dojoConfig (or djConfig). Pre-1.7, the baseUrl and modulePaths properties were used to tell Dojo where to find custom modules. Again, using the InfoWindow - Custom sample, here is how dojoConfig looked pre-1.7:
  dojoConfig = {
    parseOnLoad: true,
    baseUrl: "./",
    modulePaths: {
      "myModules": "./myModules"
    }
  };
 
At 1.7, baseUrl and modulePaths are replaced by the packages property. The value for packages is an array of objects and each object maps a name to a location. When using a CDN hosted version of Dojo (which includes the ArcGIS API for JavaScript), the easiest way to specify a package's location is to use a regular expression to grab the path used by the application and reference your JavaScirpt files relative to that. This trick was pulled from the "Using Custom Modules with a CDN" Dojo tutorial linked below. Here's how dojoConfig looks for the InfoWindow - Custom sample when using version 3.0 of the ArcGIS API for JavaScript:
  dojoConfig = {
    parseOnLoad: true,
    packages: [{
      "name": "myModules",
      "location": location.pathname.replace(/\/[^/]+$/, "") + "/myModules"
    }]
  };
 
For more information on loading custom modules, please refer to these Dojo Tutorials:
�?� Defining Modules
�?� Configuring Dojo
�?� Using Custom Modules with a CDN
Using dojo.declare
Using dojo.declare in JavaScript that's not loaded by the loader (meaning a class is declared in a file referenced directly by a script tag, or inside a script tag in an html page) and not wrapped in a function called by dojo.ready does not work at Dojo 1.7. While this worked pre-1.7, it was never recommended. There are two recommended ways to address this:
�?� Re-factor application code to use the loader to load custom classes
�?� Wrap uses of dojo.declare in a function called by dojo.ready
Below is an example of wrapping a call to dojo.declare in a function called by dojo.ready:
  dojo.ready(function() {
    dojo.declare("esri.layers.WebTileLayer", [esri.layers.TiledMapServiceLayer], {
      ...custom code here...
    });
  });
 
For additional info on changes made at Dojo 1.7, please refer to the Dojo 1.7 release notes.
0 Kudos
JohnGravois
Frequent Contributor
yup.  that comes straight out of our help.

based on changes mentioned above, it will probably be necessary to load additional modules and ensure your application waits for all modules to load before firing code in order to upgrade to version 3.x.  that being said, i haven't heard anyone say they had to rewrite existing application logic in order to upgrade.
0 Kudos
GaryBarden
New Contributor III
thanks for the feedback. It's been insightful to say the least...
0 Kudos
TracySchloss
Frequent Contributor
All of those instructions about the changes sound worse than they really are.  Most of those changes would occur in your initial javascript section of code.  Nothing in that sounds like you have to step through line by line within your functions.
0 Kudos
__Rich_
Occasional Contributor III
The effort required to upgrade our application, which I would suggest is reasonably complex/customised etc. was pretty much the square root of zero.

To put it another way, I'd get a second opinion.

I suppose it is possible that you might be dealing with something really special or perhaps written in an obscure way, I'm sure there's a consultant out there who could help the dev team out...for a fee...
0 Kudos