The steps for listing the selected parcels for the DWF Viewer are nearly the same as for the AJAX Viewer. The major difference is you must pass the selection information from the Viewer to your page.
One method to do this is to create a JavaScript function, then call this function from the Viewer using an Invoke Script command. In an HTML page that includes an embedded Viewer, add the following JavaScript function:
function listSelected()
{
xmlSel = ViewerFrame.mapFrame.GetSelectionXML();
params = new Array("SESSION",
ViewerFrame.mapFrame.GetSessionId(), "SELECTION", xmlSel);
ViewerFrame.formFrame.Submit("../devguide/dwfselection.php",
params, "taskPaneFrame");
}
In your web layout, create a new command and add it to the task list. Set the command type to Invoke Script. Set the script to invoke to
parent.listSelected();
Create a page named dwfselection.php in the devguide directory. This can be exactly the same as Example: Setting the Active Selection, with one modification. Replace the AJAX-specific code with the following:
$selection = new MgSelection($map, $_POST['SELECTION']);
When you select your command from the task list, it runs the custom JavaScript function, which passes the selection XML to dwfselection.php and loads it into the task pane.