User Guide

Results window functions 185
Example
The following example checks for errors at the offset of the current selection in the document
and, if there are errors, displays them in the specified window (
floaterName) of the Results
panel. Otherwise, it opens the Target Browser Check window of the Results panel and
displays the first visible item for the document.
var offset = dw.getDocumentDOM().source.getSelection()[0];
var errors =
dw.getDocumentDOM().source.getValidationErrorsForOffset(offset);
if ( errors && errors.length > 0 )
dw.showResults( errors[0].floaterName, errors[0].floaterIndex );
else
dw.showResults('btc', dw.getDocumentDOM().URL);
resWin.addItem()
Availability
Dreamweaver 4.
Description
Adds a new item to the Results window.
Arguments
resultWindowObj, strIcon, strDesc, itemData, iStartSel, iEndSel, colNdata
The resultWindowObj argument is the object that the createResultsWindow()
function returns
.
The strIcon argument is a string that specifies the path to the icon to use. To display a
built-in icon, use a value "1" through "10"
instead of the fully qualified path of the icon.
Specify
"0" (zero) for no icon. The following table shows the icons that correspond to the
values of "1" through "10":
The strDesc argument is a detailed description of the item. Specify "0" if there is
no description.
NOTE
Use only on stand-alone results windows created with
dreamweaver.createResultsWindow(). resWin.addItem() cannot be used with the built-
in results windows, including Validation, Browser Target Check, or Site Reports.
000_DW_API_Print.book Page 185 Wednesday, July 20, 2005 11:58 AM