This example will show how to create an HTML Reference Association. We will create an association which links from a row containing address information to a map of this address. MapQuest will provide the actual maps; all our association has to do is pass MapQuest the address information. First, an SQL Operation needs to be created to select the address information. The screenshot below shows part of the results from an address file.
You’ll notice that it contains a derived field that has a link to view map for each address. We’ll get to setting the association, but first, we need to create the HTML Reference Association. Create an Operation and set its type to HTML Reference Association. For its operations code, enter the following URL:
http://www.mapquest.com/maps/map.adp?address=??street&city=??city&state=??state&zipcode=??zipcod&zoom=8
With all operation code strings, you can specify parameters. In the above URL, there are parameters specified for the street, city, state, and zip code. That way, when the association is set on a Field, the link to the association will actually have the parameter values set from its Row’s values. The above results contain the columns: street, city, state, and zip code. So when the URL link is generated, any Row parameters are replaced with the Field’s value. The following is the link generated when for the first record, which when clicked opens up the following map.
http://www.mapquest.com/maps/map.adp?address=8959+Elm+Ave&city=Dallas&state=TX&zipcode=75217&zoom=8
In order for the link to show up in the results, the association needs to be set on a Field. In this example a derived field Derived Fields is created. A derived field isn’t absolutely necessary. The association could have been set on the street field, in which case its display value would be a link to the map.
Open up the row Manager and click the edit icon next to the FieldDescriptor for the Field you wish to have the associated map link generated for. Then change the FieldDescriptor’s association operation to the newly create HTML Reference Association.
By default the HTML Reference Association will open a different window as your application which in many cases is desired, but in some cases you may want to run the link in the same window. For this case you need to edit the HTML Reference Association operation and in the properties section add the property group Browser with the property target set to _self.
Browser {target:_self; }