Skip to content

Commit

Permalink
restore "Find" searches lost in prior update.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgee committed Apr 14, 2016
1 parent 9060127 commit 0fb818e
Show file tree
Hide file tree
Showing 2 changed files with 153 additions and 95 deletions.
7 changes: 6 additions & 1 deletion widgets/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ define([
buildFindOptions: function (layer, search) {
var searchTerm = null;
if (search.searchFields.length > 0) {
searchTerm = this.getSearchTerm(0, search.searchFields[0]);
var inputId = search.inputIds[0];
var input = registry.byId(inputId);
searchTerm = this.getSearchTerm(input, search.searchFields[0]);
if (searchTerm === null) {
return null;
}
Expand Down Expand Up @@ -811,6 +813,9 @@ define([
}
domStyle.set(search.divName, 'display', 'block');

// only show "Contains" checkbox for FindTasks
domStyle.set(this.queryContainsDom, 'display', ((layer.findOptions) ? 'block' : 'none'));

// put focus on the first input field
var input = registry.byId(search.inputIds[0]);
if (input && input.domNode) {
Expand Down
241 changes: 147 additions & 94 deletions widgets/Search/templates/Search.html
Original file line number Diff line number Diff line change
@@ -1,96 +1,149 @@
<div>
<div data-dojo-type="dijit/layout/TabContainer" data-dojo-props="region:'center'" tabStrip="true" data-dojo-attach-point="tabContainer" class="tabContainer">
<div data-dojo-attach-point="tabByAttribute" data-dojo-type="dijit/layout/ContentPane" title="${i18n.Labels.tabTitleByAttribute}" class="searchTab" selected="true">
<div class="selectALayer">
<label>${i18n.Labels.selectALayer}:</label><br>
<select style="width:100%;" data-dojo-attach-point="selectLayerByAttribute" data-dojo-type="dijit/form/Select" data-dojo-attach-event="onChange:onAttributeLayerChange"></select>
</div>
<div data-dojo-attach-point="divAttributeQuerySelect" class="searchSelector">
<label>${i18n.Labels.selectAQuery}:</label><br>
<select style="width:100%;" data-dojo-attach-point="selectAttributeQuery" data-dojo-type="dijit/form/Select" data-dojo-props="disabled:true" data-dojo-attach-event="onChange:onAttributeQueryChange"></select>
</div>
<div data-dojo-attach-point="divAttributeQueryFields" class="searchSelector searchFields">
<!-- Search dijits are injected here -->
</div>
<div data-dojo-attach-point="divAttributeSpatialFilter" class="searchSelector">
<label>${i18n.Labels.spatialFilter}:</label><br>
<select style="width:100%;" data-dojo-attach-point="selectAttributeSpatialFilter" data-dojo-type="dijit/form/Select"></select>
</div>
<div data-dojo-attach-point="divAttributeAddToExisting" class="searchSelector">
<table>
<tr valign="top">
<td>
<label style="margin-left:10px;margin-right:5px;">${i18n.Labels.attributeAddToExisting}:</label>
</td>
<td>
<input type="checkbox" data-dojo-attach-point="checkAttributeAddToExisting" data-dojo-type="dijit/form/CheckBox" />
</td>
</tr>
</table>
</div>
<div class="searchSelector bottomButtons">
<button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'fa fa-search fa-fw',showLabel:true,disabled:true" data-dojo-attach-point="btnAttributeSearch" data-dojo-attach-event="click:doAttributeSearch">${i18n.Buttons.search}</button>
<button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'fa fa-wrench fa-fw',showLabel:true,disabled:true" data-dojo-attach-point="btnQueryBuilder" data-dojo-attach-event="click:openQueryBuilder">${i18n.Buttons.openQueryBuilder}</button>
</div>
</div>
<div data-dojo-attach-point="tabByShape" data-dojo-type="dijit/layout/ContentPane" class="searchTab" title="${i18n.Labels.tabTitleByShape}">
<div class="selectALayer">
<label>${i18n.Labels.selectALayer}:</label><br/>
<select style="width:100%;" data-dojo-attach-point="selectLayerByShape" data-dojo-type="dijit/form/Select" data-dojo-attach-event="onChange:onShapeLayerChange"></select>
</div>
<div class="searchSelector">
<table>
<tr valign="top">
<td align="right">
<label>${i18n.Labels.buffer}:</label>
</td>
<td>
<input type="text" style="width:50px;" data-dojo-type="dijit/form/NumberTextBox" data-dojo-attach-point="inputBufferDistance" data-dojo-props="trim:true" data-dojo-attach-event="onChange:onSpatialBufferChange" value="0"/>
</td>
<td>
<select style="width:90px;" data-dojo-attach-point="selectBufferUnits" data-dojo-type="dijit/form/Select" data-dojo-attach-event="onChange:onSpatialBufferChange"></select>
</td>
</tr>
</table>
<table>
<tr valign="top">
<td>
<label style="margin-left:10px;margin-right:5px;">${i18n.Labels.displayBuffer}:</label>
</td>
<td>
<input type="checkbox" data-dojo-attach-point="checkBufferOnly" data-dojo-type="dijit/form/CheckBox" />
</td>
</tr>
</table>
</div>
<div class="searchSelector">
<label>${i18n.Labels.selectFeaturesBy}:</label><br/>
<button data-dojo-type="dijit/form/ToggleButton" data-dojo-attach-point="searchRectangleButtonDijit" data-dojo-props="iconClass:'draw-icon-rectangle',showLabel:false" data-dojo-attach-event="onClick:drawRectangle" title="${i18n.Buttons.selectByRectangle}"></button>
<button data-dojo-type="dijit/form/ToggleButton" data-dojo-attach-point="searchCircleButtonDijit" data-dojo-props="iconClass:'draw-icon-circle',showLabel:false" data-dojo-attach-event="onClick:drawCircle" title="${i18n.Buttons.selectByCircle}"></button>
<button data-dojo-type="dijit/form/ToggleButton" data-dojo-attach-point="searchPointButtonDijit" data-dojo-props="iconClass:'draw-icon-point',showLabel:false" data-dojo-attach-event="onClick:drawPoint" title="${i18n.Buttons.selectByPoint}"></button>
<button data-dojo-type="dijit/form/ToggleButton" data-dojo-attach-point="searchPolylineButtonDijit" data-dojo-props="iconClass:'draw-icon-polyline',showLabel:false" data-dojo-attach-event="onClick:drawPolyline" title="${i18n.Buttons.selectByPolyline}"></button>
<button data-dojo-type="dijit/form/ToggleButton" data-dojo-attach-point="searchFreehandPolylineButtonDijit" data-dojo-props="iconClass:'draw-icon-freehand-polyline',showLabel:false" data-dojo-attach-event="onClick:drawFreehandPolyline" title="${i18n.Buttons.selectByFreehandPolyline}"></button>
<button data-dojo-type="dijit/form/ToggleButton" data-dojo-attach-point="searchPolygonButtonDijit" data-dojo-props="iconClass:'draw-icon-polygon',showLabel:false" data-dojo-attach-event="onClick:drawPolygon" title="${i18n.Buttons.selectByPolygon}"></button>
<button data-dojo-type="dijit/form/ToggleButton" data-dojo-attach-point="searchFreehandPolygonButtonDijit" data-dojo-props="iconClass:'draw-icon-freehand-polygon',showLabel:false" data-dojo-attach-event="onClick:drawFreehandPolygon" title="${i18n.Buttons.selectByFreehandPolygon}"></button>
<button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'fa fa-stop',showLabel:false" data-dojo-attach-point="searchStopDrawingButtonDijit" data-dojo-attach-event="onClick:stopDrawing" title="${i18n.Buttons.stopDrawing}"></button>
<button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'fa fa-info-circle',showLabel:false,disabled:true" data-dojo-attach-point="searchIdentifyButtonDijit" data-dojo-attach-event="onClick:useIdentifiedFeatures" title="${i18n.Buttons.selectByIdentify}"></button>
<button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'fa fa-binoculars',showLabel:false,disabled:true" data-dojo-attach-point="searchSelectedButtonDijit" data-dojo-attach-event="onClick:useSelectedFeatures" title="${i18n.Buttons.selectBySelected}"></button>
</div>
<div data-dojo-attach-point="divSpatialAddToExisting" class="searchSelector">
<table>
<tr valign="top">
<td>
<label style="margin-left:10px;margin-right:5px;">${i18n.Labels.spatialAddToExisting}:</label>
</td>
<td>
<input type="checkbox" data-dojo-attach-point="checkSpatialAddToExisting" data-dojo-type="dijit/form/CheckBox" />
</td>
</tr>
</table>
</div>
<div class="searchSelector bottomButtons">
<button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'fa fa-search fa-fw',showLabel:true,disabled:true" data-dojo-attach-point="btnSpatialSearch" data-dojo-attach-event="click:doSpatialSearch">${i18n.Buttons.search}</button>
</div>
</div>
</div>
<div class="tabContainer" data-dojo-attach-point="tabContainer" data-dojo-props="region:'center'" data-dojo-type="dijit/layout/TabContainer" tabstrip="true">
<div class="searchTab" data-dojo-attach-point="tabByAttribute" data-dojo-type="dijit/layout/ContentPane" selected="true" title="${i18n.Labels.tabTitleByAttribute}">
<div class="selectALayer">
<label>
${i18n.Labels.selectALayer}:
</label>
<br>
<select data-dojo-attach-event="onChange:onAttributeLayerChange" data-dojo-attach-point="selectLayerByAttribute" data-dojo-type="dijit/form/Select" style="width:100%;">
</select>
</br>
</div>
<div class="searchSelector" data-dojo-attach-point="divAttributeQuerySelect">
<label>
${i18n.Labels.selectAQuery}:
</label>
<br>
<select data-dojo-attach-event="onChange:onAttributeQueryChange" data-dojo-attach-point="selectAttributeQuery" data-dojo-props="disabled:true" data-dojo-type="dijit/form/Select" style="width:100%;">
</select>
</br>
</div>
<div class="searchSelector searchFields" data-dojo-attach-point="divAttributeQueryFields">
<!-- Search dijits are injected here -->
</div>
<div data-dojo-attach-point="queryContainsDom">
<input data-dojo-attach-point="containsSearchText" data-dojo-props="'class':'optionsCheckBox'" data-dojo-type="dijit/form/CheckBox" type="checkbox"/>
<label>
${i18n.Labels.exactMatches}
</label>
</div>
<div class="searchSelector" data-dojo-attach-point="divAttributeSpatialFilter">
<label>
${i18n.Labels.spatialFilter}:
</label>
<br>
<select data-dojo-attach-point="selectAttributeSpatialFilter" data-dojo-type="dijit/form/Select" style="width:100%;">
</select>
</br>
</div>
<div class="searchSelector" data-dojo-attach-point="divAttributeAddToExisting">
<table>
<tr valign="top">
<td>
<label style="margin-left:10px;margin-right:5px;">
${i18n.Labels.attributeAddToExisting}:
</label>
</td>
<td>
<input data-dojo-attach-point="checkAttributeAddToExisting" data-dojo-type="dijit/form/CheckBox" type="checkbox"/>
</td>
</tr>
</table>
</div>
<div class="searchSelector bottomButtons">
<button data-dojo-attach-event="click:doAttributeSearch" data-dojo-attach-point="btnAttributeSearch" data-dojo-props="iconClass:'fa fa-search fa-fw',showLabel:true,disabled:true" data-dojo-type="dijit/form/Button">
${i18n.Buttons.search}
</button>
<button data-dojo-attach-event="click:openQueryBuilder" data-dojo-attach-point="btnQueryBuilder" data-dojo-props="iconClass:'fa fa-wrench fa-fw',showLabel:true,disabled:true" data-dojo-type="dijit/form/Button">
${i18n.Buttons.openQueryBuilder}
</button>
</div>
</div>
<div class="searchTab" data-dojo-attach-point="tabByShape" data-dojo-type="dijit/layout/ContentPane" title="${i18n.Labels.tabTitleByShape}">
<div class="selectALayer">
<label>
${i18n.Labels.selectALayer}:
</label>
<br/>
<select data-dojo-attach-event="onChange:onShapeLayerChange" data-dojo-attach-point="selectLayerByShape" data-dojo-type="dijit/form/Select" style="width:100%;">
</select>
</div>
<div class="searchSelector">
<table>
<tr valign="top">
<td align="right">
<label>
${i18n.Labels.buffer}:
</label>
</td>
<td>
<input data-dojo-attach-event="onChange:onSpatialBufferChange" data-dojo-attach-point="inputBufferDistance" data-dojo-props="trim:true" data-dojo-type="dijit/form/NumberTextBox" style="width:50px;" type="text" value="0"/>
</td>
<td>
<select data-dojo-attach-event="onChange:onSpatialBufferChange" data-dojo-attach-point="selectBufferUnits" data-dojo-type="dijit/form/Select" style="width:90px;">
</select>
</td>
</tr>
</table>
<table>
<tr valign="top">
<td>
<label style="margin-left:10px;margin-right:5px;">
${i18n.Labels.displayBuffer}:
</label>
</td>
<td>
<input data-dojo-attach-point="checkBufferOnly" data-dojo-type="dijit/form/CheckBox" type="checkbox"/>
</td>
</tr>
</table>
</div>
<div class="searchSelector">
<label>
${i18n.Labels.selectFeaturesBy}:
</label>
<br/>
<button data-dojo-attach-event="onClick:drawRectangle" data-dojo-attach-point="searchRectangleButtonDijit" data-dojo-props="iconClass:'draw-icon-rectangle',showLabel:false" data-dojo-type="dijit/form/ToggleButton" title="${i18n.Buttons.selectByRectangle}">
</button>
<button data-dojo-attach-event="onClick:drawCircle" data-dojo-attach-point="searchCircleButtonDijit" data-dojo-props="iconClass:'draw-icon-circle',showLabel:false" data-dojo-type="dijit/form/ToggleButton" title="${i18n.Buttons.selectByCircle}">
</button>
<button data-dojo-attach-event="onClick:drawPoint" data-dojo-attach-point="searchPointButtonDijit" data-dojo-props="iconClass:'draw-icon-point',showLabel:false" data-dojo-type="dijit/form/ToggleButton" title="${i18n.Buttons.selectByPoint}">
</button>
<button data-dojo-attach-event="onClick:drawPolyline" data-dojo-attach-point="searchPolylineButtonDijit" data-dojo-props="iconClass:'draw-icon-polyline',showLabel:false" data-dojo-type="dijit/form/ToggleButton" title="${i18n.Buttons.selectByPolyline}">
</button>
<button data-dojo-attach-event="onClick:drawFreehandPolyline" data-dojo-attach-point="searchFreehandPolylineButtonDijit" data-dojo-props="iconClass:'draw-icon-freehand-polyline',showLabel:false" data-dojo-type="dijit/form/ToggleButton" title="${i18n.Buttons.selectByFreehandPolyline}">
</button>
<button data-dojo-attach-event="onClick:drawPolygon" data-dojo-attach-point="searchPolygonButtonDijit" data-dojo-props="iconClass:'draw-icon-polygon',showLabel:false" data-dojo-type="dijit/form/ToggleButton" title="${i18n.Buttons.selectByPolygon}">
</button>
<button data-dojo-attach-event="onClick:drawFreehandPolygon" data-dojo-attach-point="searchFreehandPolygonButtonDijit" data-dojo-props="iconClass:'draw-icon-freehand-polygon',showLabel:false" data-dojo-type="dijit/form/ToggleButton" title="${i18n.Buttons.selectByFreehandPolygon}">
</button>
<button data-dojo-attach-event="onClick:stopDrawing" data-dojo-attach-point="searchStopDrawingButtonDijit" data-dojo-props="iconClass:'fa fa-stop',showLabel:false" data-dojo-type="dijit/form/Button" title="${i18n.Buttons.stopDrawing}">
</button>
<button data-dojo-attach-event="onClick:useIdentifiedFeatures" data-dojo-attach-point="searchIdentifyButtonDijit" data-dojo-props="iconClass:'fa fa-info-circle',showLabel:false,disabled:true" data-dojo-type="dijit/form/Button" title="${i18n.Buttons.selectByIdentify}">
</button>
<button data-dojo-attach-event="onClick:useSelectedFeatures" data-dojo-attach-point="searchSelectedButtonDijit" data-dojo-props="iconClass:'fa fa-binoculars',showLabel:false,disabled:true" data-dojo-type="dijit/form/Button" title="${i18n.Buttons.selectBySelected}">
</button>
</div>
<div class="searchSelector" data-dojo-attach-point="divSpatialAddToExisting">
<table>
<tr valign="top">
<td>
<label style="margin-left:10px;margin-right:5px;">
${i18n.Labels.spatialAddToExisting}:
</label>
</td>
<td>
<input data-dojo-attach-point="checkSpatialAddToExisting" data-dojo-type="dijit/form/CheckBox" type="checkbox"/>
</td>
</tr>
</table>
</div>
<div class="searchSelector bottomButtons">
<button data-dojo-attach-event="click:doSpatialSearch" data-dojo-attach-point="btnSpatialSearch" data-dojo-props="iconClass:'fa fa-search fa-fw',showLabel:true,disabled:true" data-dojo-type="dijit/form/Button">
${i18n.Buttons.search}
</button>
</div>
</div>
</div>
</div>

0 comments on commit 0fb818e

Please sign in to comment.