Select to view content in your preferred language

Enhanced-Search-Widget-for-FlexViewer Part II

137454
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
SimonMorgan
Frequent Contributor
Robert,

I am having an issue with your 3.0 widget crashing on me. I have a viewer with a bunch of expressions setup. Here are the occasion when it crashes although not consistently:


  1. When clicking the relate button for a record with no related record

  2. after closing the data grid, the whole flexviewer acts odd, in my most recnet test all my widgets got renamed search

  3. conducting a search without clearing the previous search

  4. sometimes the data grid doesn't list results, you have to open and close it a couple times


Also, I cannot get attachments to work. It says this layer does not support attachments or says nothing at all!

I am not sure what is going on however I did have an issue installing it into the app buidler. It asks me to overwrite the existing search widget, then when close appbuilder and re-open, the viewer with the esearch widget has reverted back tot he Esri search widget and the esearch is not listed in manage custom widgets. I have to re-install it into the appbuilder. I downloaded on 6/19/12

My flex viewer: http://gis2.threeriversparkdistrict.org/swan/xings_dev

Currently, the only point with a related record is crossing ID 182

My config file for esearch:

<configuration>

<layers>
  <layer>
   <definitionexpression/>
   <enableexport>true</enableexport>
   <name>Trail Crossings</name>
   <url>http://gis.threeriversparkdistrict.org/arcgis/rest/services/WebEditing/WebEdit_xings_071012/MapServe...</url>
   <expressions>
    <expression alias="Crossing ID" textsearchlabel="Search by crossing ID...">
     <value prompt="Example: 123">CrossingID = '[value]'</value>
    </expression>
    <expression alias="County" textsearchlabel="Select crossing in or not in a county">
     <value prompt="IN or NOT IN County" userlist="IN,NOT IN">County [value]</value>
     <value prompt="Which County?" field="County" usedomain="true" fromsubtype="true">('[value]')</value>
    </expression>
    <expression alias="City" textsearchlabel="Select crossing in or not in a City">
     <value prompt="IN or NOT IN City" userlist="IN,NOT IN">City [value]</value>
     <value prompt="Which City?" field="City" usedomain="true" fromsubtype="true">('[value]')</value>
    </expression>
    <expression alias="ADT and Lanes" textsearchlabel="Show me all crossings with 4 or 5 lanes and an ADT in excess of">
     <value prompt="Enter AADT value -1, so 8999 for 9000">NumLns in ( '4' , '5' ) and AADT &gt; '[value]'</value>
    </expression>
    <expression alias="Stop Ahead Signs" textsearchlabel="Are stop ahead signs needed?">
     <value prompt="Is there a stop ahead sign?" field="TrlStopAhead" usedomain="true" fromsubtype="true">TrlStopAhead = '[value]'</value>
     <value prompt="Is a sign needed?" field="TrlStopAhead_Needed" usedomain="true" fromsubtype="true">AND TrlStopAhead_Needed = '[value]'</value>
    </expression>
    <expression alias="Trail Crossing Sign and Visibility" textsearchlabel="For crossings with a trail crossing sign, what is the quality of the visibility?">
     <value field="TrlXingAheadatInt_visible" usedomain="true" fromsubtype="true">TrlXingAheadatInt = 'Yes' and TrlXingAheadatInt_visible = '[value]'</value>
    </expression>
    <expression alias="Crossing Transition Type" textsearchlabel="Show me all crossings with the following type of transition:">
     <value field="TransitionType" usedomain="true" fromsubtype="true">TransitionType = '[value]'</value>
    </expression>
    <expression alias="Intersection Name" textsearchlabel="Search by intersection name...">
     <value>IntersectionName Like '%[value]%'</value>
    </expression>
    <expression alias="Trail" textsearchlabel="Search by trail name...">
     <value field="TrailName" usedomain="true" fromsubtype="true">TrailName = '[value]'</value>
    </expression>
    <expression alias="Park" textsearchlabel="Search by trail...">
     <value field="Park" usedomain="true" fromsubtype="true">Park = '[value]'</value>
    </expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select crossings</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>IntersectionName</titlefield>
   <fields all="false">
    <field name="CrossingID" gridfield="true"/>
    <field name="IntersectionName" gridfield="true"/>
    <field name="Park" gridfield="true"/>
    <field name="TrailName" gridfield="true"/>
    <field name="City" gridfield="true"/>
    <field name="County" gridfield="true"/>
    <field name="LastInspDate" gridfield="true"/>
    <field name="TrlXingAssess" gridfield="true"/>
    <field name="XingType" gridfield="true"/>
    <field name="AADT" gridfield="true"/>
    <field name="ADT_Yr" alias="ADT Year Determined" gridfield="true"/>
    <field name="IntRd_SpeedLimit" alias="Speed Limit" gridfield="true"/>
    <field name="NumLns" gridfield="true" gridfieldonly="true"/>
    <field name="CentIsland" gridfield="true" gridfieldonly="true"/>
    <field name="CentIsland_CurbOpen" gridfield="true" gridfieldonly="true"/>
    <field name="CentIsland_TruncDome" gridfield="true" gridfieldonly="true"/>
    <field name="XwalkPaint" gridfield="true" gridfieldonly="true"/>
    <field name="RdControl" gridfield="true" gridfieldonly="true"/>
    <field name="TrlControl" gridfield="true" gridfieldonly="true"/>
    <field name="TrlStopAhead" gridfield="true" gridfieldonly="true"/>
    <field name="TrlStopAhead_Needed" gridfield="true" gridfieldonly="true"/>
    <field name="TrlXingAheadatInt" gridfield="true" gridfieldonly="true"/>
    <field name="TrlXingAheadatInt_visible" gridfield="true" gridfieldonly="true"/>
    <field name="SightLinesAssess" gridfield="true" gridfieldonly="true"/>
    <field name="TransitionType" gridfield="true" gridfieldonly="true"/>
    <field name="TransitionType_TruncDomes" gridfield="true" gridfieldonly="true"/>
    <field name="TransitionType_Material" gridfield="true" gridfieldonly="true"/>
    <field name="VehicularAccess" gridfield="true" gridfieldonly="true"/>
    <field name="FieldNotes" gridfield="true" gridfieldonly="true"/>
    <field name="OfficeNotes" gridfield="true" gridfieldonly="true"/>
   </fields>
   <links>
    <link includeinresults="false" field="" alias="">
     <linkprefix></linkprefix>
     <linksuffix></linksuffix>
     <iconfield></iconfield>
     <iconprefix></iconprefix>
     <iconsuffix></iconsuffix>
    </link>
   </links>
   <zoomscale usegeometry="true" zoompercent="1.6"/>
   <autoopendatagrid>false</autoopendatagrid>
   <relates>
    <relates>
     <relate id="0" label="Trail Crossing Videos" enableexport="true">
      <!--icon="assets/images/i_videocam.png"-->
      <fields all="false">
       <field name="DateRecorded" alias="Date Recorded"/>
       <field name="TimeRecorded" alias="Time Recorded"/>
       <field name="Comments" />
       <field name="Path" hyperlinkgridfield="true" hyperlinkaliastext="Play Video" linksuffix="" linkprefix="" />
      </fields>
     </relate>
    </relates>
   </relates>
   <queryattachments>true</queryattachments>
  </layer>
</layers>
<tables>
  </tables>
CODE]
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Simon,

   You seem to have some overall Flex Viewer errors:

Error: Could not find compiled resource bundle 'ViewerStrings' for locale 'en_US'.
    at mx.resources::ResourceManagerImpl/installCompiledResourceBundle()
    at mx.resources::ResourceManagerImpl/installCompiledResourceBundles()
    at mx.core::FlexModuleFactory/installCompiledResourceBundles()
    at mx.core::FlexModuleFactory/docFrameHandler()
    at mx.core::FlexModuleFactory/docFrameListener()


And your next issue is you have updated portions of your SearchWidget.xml to the new 3.0 version standard but not all.

Links does not look like this any more:
<links>
    <link includeinresults="false" field="" alias="">
        <linkprefix></linkprefix>
        <linksuffix></linksuffix>
        <iconfield></iconfield>
        <iconprefix></iconprefix>
        <iconsuffix></iconsuffix>
    </link>
</links>


Next you have relates and then relates again before you have your first relate... That is just going to screw things up royally.
<relates>
<relates>
<relate id="0" label="Trail Crossing Videos" enableexport="true">
<!--icon="assets/images/i_videocam.png"-->
<fields all="false">
<field name="DateRecorded" alias="Date Recorded"/>
<field name="TimeRecorded" alias="Time Recorded"/>
<field name="Comments" />
<field name="Path" hyperlinkgridfield="true" hyperlinkaliastext="Play Video" linksuffix="" linkprefix="" />
</fields>
</relate>
</relates>
</relates>
0 Kudos
SimonMorgan
Frequent Contributor
Thank you for the fixes to my config file. You do great work as always.

However, I was still having issues and couldn't figure the other error messgae you pointed out about my viewer overall. I am hacving problems with installing your widget via appbuilder. It asks to overwrite the existing search widget, then then I re-open app builder it reverts back to the Esri search widget but tries to use your config file. So I rebuilt my viewer from scrtach but this time loaded your widget using the compiled version and manually added OUTSIDE of appbuilder the old fashioned way. It works fine except I still don't see attachments in the pop ups.

So I still have 2 issues:

1. No attachments
2. Conflicts when attempting to install via appbuilder

I know how to work around 2, but wanted to let you know just in case it wasn't just my setup that this was occuring with. Any suggestions on what might be going on with 1?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Simon,

   Number two really concerns me... What are the steps you are taking to add the eSearch widget to your AppBuilder?

Number one, are you looking for the attachments in the popup window? because that is where they will be.
0 Kudos
SimonMorgan
Frequent Contributor
Simon,

   Number two really concerns me... What are the steps you are taking to add the eSearch widget to your AppBuilder?

Number one, are you looking for the attachments in the popup window? because that is where they will be.


Steps to add to appbuilder:

1. Click Settings
2. Click Show Advanced Settings
3. Click Manage Custom Widgets
4. Click Add
5. Navigate to ...\eSearch\For_AppBuilder3.0, Click eSearch.zip then click Open.
6. Click Yes when asked if I want to replace existing search widget (even the first time I added it)
7. Click Yes when asked if I want to update all my applications

If I click cancel in step 6, i get the following error: "Custom widget import failed: Process cancelled by user"
I have also tried clicking no in step 7 but get the same results (widget conflicts)

This does not happen with any of your other widgets. What it does is move your wiodget into the Esri search widget folder. Then when I re-open appuilder, the app builder replace the swf with the esri version but does not update the xml to the esri one.


As for attachments, I have been looking in the popup but to no avail.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Simon,

   So I just tested on a new machine that has never had App Builder and did the app builder install and then followed the steps you used (which are exactly what you should be doing) and the only message I get is this: "Custom Widget Imported Successfully" and it shows the binoculars and Enhanced SearchWidget.

An Idea on the Attachments issue can you include OBJECTID in your fields list and test again?
0 Kudos
SimonMorgan
Frequent Contributor
Simon,

   So I just tested on a new machine that has never had App Builder and did the app builder install and then followed the steps you used (which are exactly what you should be doing) and the only message I get is this: "Custom Widget Imported Successfully" and it shows the binoculars and Enhanced SearchWidget.

An Idea on the Attachments issue can you include OBJECTID in your fields list and test again?


Is it still there after you close and re-open the appbuilder? One thign I was wodnering is could it be because your esearch swf file is called searchwidgeta nd so attempts to override the existing widget where as your edraw swf is called edarwwidgeta nd so is in addition to the existing draw widget? I have not had chance to tryt he objectID fix but will report back when I do so there is record of how it worked.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,

   The new version 3.0.1 is now available.

Version 3.0.1 - 7/26/2012

* The name of the swf and xml file has changed to eSearchWidget.swf and eSearchWidget.xml
* Fixed application hang bug when using the eSearch and new 3.0 print widget.
* Added autozoom configuration to zoom to the selected features automatically when a search is complete.
* Added keepgraphicalsearchenabled configuration option to keep the graphical selection tool that the
  user chooses active even after a selection has been made. This means that you will not have to clear
  your selection and re-choose a graphical selection tool in order to make another selection.
* Added autohide to the fixed datagrid. Control of this is now in the SearchWidgetFixedDG.xml file.
* Added predefined datagrid column sorting to all the datagrids.
0 Kudos
AdamZiegler
Deactivated User
Robert,

Thank you again for awesome widgets that make us look good!  I just grabbed the latest version (3.01) and the floating data grid doesn't seem to enable....I though I had done something wrong in the config, so I installed is fresh and still no data grid option.  Am I doing something wrong?

Thanks in advance,
Adam Z
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Adam,

   The issue is that I left the eSearchWidget.xml set to:
<floatorfixed>fixed</floatorfixed><!-- possible values are fixed and float -->

If you go in and change that to float it will work fine for you. I will change it to float in the download ASAP.
0 Kudos