Enhanced-Search-Widget-for-FlexViewer Part II

87335
552
04-19-2012 08:03 AM
RobertScheitlin__GISP
MVP Emeritus
All,

   I am pleased to announce the next release of my eSearch Widget.

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

Version 2.5.1.7 - 4/19/2012
* Added ability to search (flat/standalone/no geometry) tables.
* This time all Zooming uses the same scaling (popup, datagrid, widget results, zoom to all).
* Added Relates icon/button to datagrids so that you can click on it in the datagrid to
  open relates choice dialog.
* Move all skins to a skins package for cleaner organization.
* Links that are not associated with a field now work.
* Ability to disable the relates tab in the fixed widget is now configurable.
552 Replies
RobertScheitlin__GISP
MVP Emeritus
Michael,

   GitHub is only for source code.

At the code gallery page:

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

scroll down to the:

Code Attachment eSearch.zip Download

and click the download button.
0 Kudos
MichelleKinseth
New Contributor II
Hi Robert,
I have the latest version of your great widget running (3.0.11), and was wondering if there was a way to make the search happen with the click of the mouse, so instead of making the user have to click the "Search" button in the widget after placing a point or drawing a poly on the map the search happens as soon as a point or poly is drawn.

The 2.5 version (of your widget) I had running in the viewer I inherited had this method working but I can't tell if it was innate in your code for that version, or if edits were made on this end. I would appreciate any help you can provide!

I also need to remove the "include text query in search selection" checkbox from the widget, as this is not applicable to my viewer...but I can't seem to find all the right lines to comment out for this.

I'm comfortable making changes to the xmxl's if need be.

Thank you so much,
Michelle
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Michelle,

   Sure the thing about have to click the search button is because you have the enable multi part graphic search checked in the GUI. If you want to disable this then in the eSearchWidget.xml change this line to false:

<multipartgraphicsearch>true</multipartgraphicsearch>


As far as code changes to make to the eSearchWidget.mxml to remove the "include text query in selection criteria" you will have to search for this id "includeTextQuery" and add a visible and includeinlayout properties and set both to false.
0 Kudos
MichelleKinseth
New Contributor II
Michelle,

   Sure the thing about have to click the search button is because you have the enable multi part graphic search checked in the GUI. If you want to disable this then in the eSearchWidget.xml change this line to false:

<multipartgraphicsearch>true</multipartgraphicsearch>


Thanks Robert! I was able to remove the "Search" button, but I'm still having issues as no actual search occurs when I draw a polygon on the map. I have the enable multi-part features checkbox selected by default upon map launch, and I also have several lines in the mxml commented out that disable search results showing in the widget window and in a popup - would that be conflicting with this? 


As far as code changes to make to the eSearchWidget.mxml to remove the "include text query in selection criteria" you will have to search for this id "includeTextQuery" and add a visible and includeinlayout properties and set both to false.


This worked great, thanks!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Michelle,

   There is no telling really. I can only support the widget in an unmodified state. Once you being making changes it is not in the best interest of my time to support the widget any longer.

I was able to remove the "Search" button
What do you mean by this? if you set
<multipartgraphicsearch>false</multipartgraphicsearch>
than you do not have to do anything else to remove the search button, and once you finish drawing your geometry the search will automatically execute.
0 Kudos
RhettZufelt
MVP Frequent Contributor
All,

   The next new release is available:

Version 3.0.11 - 10/17/2012
* Added uniquevalsfromfield as a source for search drop down (like usedomain and userlist options).
  This now queries the map service for unique values of a field to use in the dropdown.



Robert,

I recently updated to the 3.0.11 eSearch and have noticed an odd behaviour/bug.  I am trying to use the uniquevalsfromfield="[FIELD]" and for the most part is working great.  However, it doesn't seem to matter what field or service I am searching, if the first expression in the first layer in my xml has the uniquevalsfromfield option, the little clock timer will never stop running, even after clearing/closing the widget.  It still gets the unique list and does the search, but the progress clock makes people think it is "working".

While on the subject, if there is any NULL values in the field, "null" will be at the bottom of the list, however, if you try to search by null, you will get zero values.  Seems like the null should either not show up on the list, OR actually select the features where field is null.

Guess while I'm on the subject, I'll throw in an enhancement request as well.  Would it be possible, when using the uniquevalsfromfield option to have it also append the "all" to the end of the list so we still have the option to select everything?

Thanks again and another great enhancement to the widget (can quit using my python routine to update the list now),

R_
0 Kudos
MichelleKinseth
New Contributor II
Michelle,

   There is no telling really. I can only support the widget in an unmodified state. Once you being making changes it is not in the best interest of my time to support the widget any longer.

What do you mean by this? if you set
<multipartgraphicsearch>false</multipartgraphicsearch>
than you do not have to do anything else to remove the search button, and once you finish drawing your geometry the search will automatically execute.


Sure, I understand. I was able to remove the Search button from the widget (it's not visible any longer) but the search doesn't automatically execute. I will troubleshoot a little further - and test on an unmodified version of the widget. Thanks again.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   Not sure what gave you the idea that the field name needs to be in square brackets but it does not it is a string attribute

uniquevalsfromfield="ZONING_TYPE"
As far as adding the "all" to the list I will consider that. For the null value issue I will have to look into it.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Michelle,

   Do you mean that you manually (in the code made the button not visible) or you used the method of setting the multipartgraphicsearch to false in the XML?
0 Kudos
RhettZufelt
MVP Frequent Contributor
Robert,

I just used the square brackets to indicate that it was a field name. I do not have a field named FIELD.

<layer>
<definitionexpression></definitionexpression>
<enableexport>true</enableexport>
<name>Search</name>
<url>http://gis01.wch-rcc.com/ArcGIS/rest/services/SDCV_custom/wastebuffers/MapServer/0</url>
<expressions>
 <expression alias="Designated Area" textsearchlabel="Pick an Area from the List:" isvaluerequired="false">
  <values>
   <value userlist="100BC,100D,100F,100H,100K,100N,300,600,all" isvaluerequired="false">summary_DESG_AREA = '[value]'</value>
   <value uniquevalsfromfield="summary_DESG_AREA " isvaluerequired="false">summary_DESG_AREA = '[value]'</value>
  </values>
 </expression>

 <expression alias="Latest Activity    " textsearchlabel="Select an Activity from the List:" isvaluerequired="false">
  <values>
                             <value uniquevalsfromfield="summary_Note" isvaluerequired="false">summary_Note = '[value]'</value> 
                             <value userlist="Closure,Confimatory,RTD,all" isvaluerequired="false">summary_Note = '[value]'</value>
  </values>
 </expression>


</expressions>
<graphicalsearchlabel>Use one of the graphical search tools to select Zoning</graphicalsearchlabel>
<spatialsearchlayer>true</spatialsearchlayer>
<titlefield>SITECODE</titlefield>
<fields all="false">
 <field name="SITECODE"/>
 <field name="SITECODE" alias="SiteCode" gridfield="true" gridfieldonly="true"/>
 <field name="summary_Date" alias="Activity Date     " gridfield="true" gridfieldonly="true" dateformat="MM/DD/YYYY" useutc="true" />
 <field name="summary_Note" alias="Latest Activity" gridfield="true" gridfieldonly="true" />
 <field name="summary_SortOrder " alias="Sort Order" gridfield="true" gridfieldonly="true"/>
 <field name="summary_LVL1Stage" alias="Level 1 Stage" gridfield="true" gridfieldonly="true"/>
 <field name="summary_SPIF_reclass" alias="SPIF Reclass" gridfield="true" gridfieldonly="true"/>
 <field name="summary_SPIF_backfill" alias="SPIF Backfill" gridfield="true" gridfieldonly="true"/>
 <field name="summary_SPIF_Reveg" alias="SPIF Reveg" gridfield="true" gridfieldonly="true"/>
 <field name="summary_TPA_Milestones" alias="Milestone" gridfield="true" gridfieldonly="true"/>
 <field name="summary_Milestone_Date" alias="Milestone Date"  gridfield="true" gridfieldonly="true" />
 <field name="summary_DESG_AREA" alias="Designated Area   " gridfield="true" gridfieldonly="true" sort="asc|1|string"/>
 <field name="summary_WBS_6" alias="WBS_6" gridfield="true" gridfieldonly="true"/>
 <field name="summary_FINAL_ROD_DEC_UNIT" alias="summary_FINAL_ROD_DEC_UNIT" gridfield="true" gridfieldonly="true"/>
 <field name="summary_ContractMod" alias="ContractMod     " gridfield="true" gridfieldonly="true"/>
</fields>
</layer>




Of course I only use ONE of the first value expressions above. For Designated Area, the blue one works fine, the red one will make the clock cursor spin indefinatly.
However, either of them on the Latest Activity will work fine.
If I switch them so that the Latest Activity expression is before the Designated area, then I can't use the uniquevalsfromfield without the indefinate clock cursor.

Hope this makes it more clear.

R_
0 Kudos