cliveswan

Pass data from infoWindow to webpage

Discussion created by cliveswan on Mar 22, 2012
Latest reply on Mar 23, 2012 by cliveswan
I am currently publishing data to the infoWindow.
The data is readable in the infoWindow if there are less than 10 columns. After approx. 10 columns the user has to scroll the page.

The data is passed to the infoWindow (below).
>>>>>>>>>>>>>>>>
if(theLayerName == "Underground") {
contentPane.setContent(COL_FormatIdentify.Underground(theResults, theLayerName));
} else if(theLayerName != "Underground")   {

// LOOP TO CATCH >1 RECORD
if( (theLayerName != "Underground") && (idResults.length  <= 10) )
{
alert("1 record");
contentPane.setContent(layerTabContent(theResults, theLayerName)); }

else if ( (theLayerName != "Underground") && (idResults.length  > 10) )
{
contentPane.setContent(COL_FormatIdentify.MultiRecords(theResults, theLayerName)); }
   }
}
>>>>>>>>>>>>>>>

The infoWindow can provide a URL to launch a webpage.
<b> How does the webpage pull in the data from COL_FormatIdentify.MultiRecords = function(layerResults, theLayerName)?? <b>

>>>>>>>>>>>>>>>
// PROVIDES FORMAT FOR MULTIPLE RECORDS TABLE
//
COL_FormatIdentify.MultiRecords = function(layerResults, theLayerName) {
    //create a new array of field names from the results returned by identify
    var featAttrs = layerResults.features[0].attributes;
    var attrNames = [];
    for(var i in featAttrs) {
        attrNames.push(i);
    }
    var content = "";
    content += "<span class='infoWindowTextSmall'>" + "Records found: " + layerResults.features.length + "</span>";
    content += "<hr style='color:#EDEDED;background-color:#EDEDED;height:4px; width:100%;'  />";
    content += "<div class ='CustomInfoWindowContent' >";

    dojo.forEach(layerResults.features, function(f) {
        content += "<span class='infoWindowTitle'>" + f.attributes['NAME_999'] + "</span>";
        content += "<br />";
        content += "<p class='link'><a href='http://localhost/COLGISJS01/test.html'>RECORDS </a></p>";
    });
    content += "</div>";

    return content;
}
>>>>>>>>>>>>>>>>>>>>>>>>>>

Any suggestions or an example??

Outcomes