Select to view content in your preferred language

Enhanced-Search-Widget-for-FlexViewer Part III

143904
776
04-30-2013 03:58 PM
RobertScheitlin__GISP
MVP Emeritus
All,

   Here is a new thread to post questions and discuss the Enhanched Search Widget. The old thread was getting too long.
Tags (2)
776 Replies
RobertScheitlin__GISP
MVP Emeritus
Nick,

   It sounds like you did not add the SearchWidgetFixedDG.mxml to your Projects modules list (so that Flash Builder Knows to build a swf for it).
0 Kudos
NicholasMcNamara
Frequent Contributor
Nick,

   It sounds like you did not add the SearchWidgetFixedDG.mxml to your Projects modules list (so that Flash Builder Knows to build a swf for it).


Quite possible, since I was unaware that any such thing existed. Also, I cannot find anything that looks like a "Projects modules list." I'm using the Flash Viewer. Any references I've seen to this seem to talk about the API users.

I'm just going to Settings > Advanced > Manage Custom Widgets. The DG does not appear in there, just eSearch (thought that covered it), and other widgets I have. That's how I update them. How can I make this update property in the future?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nick,

   OK terminology is tripping us up here. You are using Application Builder. Application Builder does not support layout widgets which the Fixed Datagrid widget is.
0 Kudos
NicholasMcNamara
Frequent Contributor
OK, well it works anyway. I'll just have to remember to update any SWFs manually if they are layout widgets. Good to know.
0 Kudos
CaseyMcMillin
Emerging Contributor
Casey,

   I don't know what else to tell you as I have now setup a Featureclass, a table, and a relationship Class in an Enterprise Geodatabase and tested a link to a pdf from a field in the related table and it works fine....


Robert,
I have tested and get the error every time I use a relationship class (enterprise, file gdb, etc).  I hate to keep pestering you with this, but could you possibly try the attached data and see if you get the error? It occurs any time you interact with the fixed data grid (even when you click on the grid away from the hyperlink). If I export the feature class and table somewhere else (without the relationship class) and set up the relate in the map document it works fine, but that obviously won't work long term for me.
Thanks again,
Casey
0 Kudos
HudsonSmith
Emerging Contributor
Hello here is my current code for searching for InstallationDates on water hydrants and this code currently works, but I would also like the user to be able to search for more than one date. As of right now its a drop down list of dates that the user can select. I would  like them to be able to select multiple dates at once like say they wanted 5/3/2010, 5/5/2010, 6/12/1010 etc. I am having trouble finding a solution and would love some help. Thank you!


<expression alias="InstallationDate" textsearchlabel="Search by InstallationDate [ Example: MM/DD/YYYY ]:">
                    <values>
                        <value prompt="Example: 5/15/1985" isvaluerequired="false" uniquevalsfromfield="InstallationDate" dateformat="MM/DD/YYYY" useutc="True">InstallationDate = date'[value]'</value>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Hudson,

   There is no good way currently in the GUI to make multiple selections from one field and dates complicate things even more.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Casey,

   OK, finally I am able to see your configuration issue. I am expecting a zoomscale tag in your relate tag. As indicated in red below and you need to remove or change the symbology tag you have (which is now for a Polygon and your layer is a PolyLine), Your FacilityID field is a numeric field so your expression should not wrap the [value] in single quotes (which is the way you do for strings). The same goes for your Diameter field expression. It is normally little attention to detail things like this that trip people up. In the Next version I will do some better error traping for things like the missing zoomscale tag.

        <layer>
            <token />
            <definitionexpression />
            <enableexport>true</enableexport>
            <name>Sanitary Main</name>
            <url>http://GIS01.lebanon.local:6080/arcgis/rest/services/OperationalLayers/Utilities/MapServer/3</url>
            <expressions>
                <expression alias="Facility ID" textsearchlabel="Search Specific Main:" isvaluerequired="false">
                    <values>
                        <value prompt="Example: 1032" isvaluerequired="false">FACILITYID = [value]</value>
                    </values>
                </expression>
                <expression alias="Attributes" textsearchlabel="Search Mains:" isvaluerequired="false">
                    <values>
                        <value prompt="Type:" isvaluerequired="false" uniquevalsfromfield="TYPE" autosubmit="false">TYPE = '[value]'</value>
                        <value prompt="Diameter:" isvaluerequired="false" uniquevalsfromfield="DIAMETER" autosubmit="false" operator="AND">DIAMETER = [value]</value>
                        <value prompt="Material:" isvaluerequired="false" uniquevalsfromfield="MATERIAL" autosubmit="false" operator="AND">MATERIAL = '[value]'</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Main</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>Sanitary Main</titlefield>
            <fields all="false">
                <field name="FACILITYID" gridfield="true" />
                <field name="TYPE" gridfield="true" />
                <field name="DIAMETER" gridfield="true" />
                <field name="MATERIAL" gridfield="true" />
                <field name="YEARBUILT" gridfield="true" />
                <field name="EDITDATE" gridfield="true" />
                <field name="INSPECTIONDATE" gridfield="true" />
            </fields>
            <links />
            <zoomscale usegeometry="true" zoompercent="2" />
            <autoopendatagrid>false</autoopendatagrid>
            <queryattachments>false</queryattachments>
            <relates>
                <relate id="0" label="Asbuilts" enableprintgrid="false">
                    <fields all="false">
                        <field name="ASBUILTID" />
                        <field name="FILEPATH" hyperlinkgridfield="true" hyperlinkaliastext="View Asbuilt" linkprefix="http://GIS01/Asbuilts/" linksuffix=".pdf" />
                    </fields>
                    <zoomscale usegeometry="true" zoompercent="1.6" />
                </relate>
            </relates>
            <symbology>
                <simplefillsymbol color="0xff0000" alpha="0.5">
                    <outline color="0xff0000" alpha="0.8" width="2"/>
                </simplefillsymbol>
            </symbology>
        </layer> 
0 Kudos
AngieAllison
Emerging Contributor
Robert - I am using the 3.0 version (compiled) that I just downloaded today and have started at the top of the xml to try and get this to work. I am still learning xml so sorry if this doesn�??t make sense. i was using the SELECTION widget but you were so kind as to let me know that it is no longer supported, so I have started trying to configure this one.   I have some questions if you would be so kind. I have read thru this forum and the pdf that is in the 3.3 version.  I have the widget working so far �?? but..
You added functionality to * If multi field expressions are used, now all fields DO NOT have to be filled.
How do you do this?  I am trying it and it just runs with all the fields that are domain values no matter what I do.  Here is the xml (part of it) that I am using
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>Water Mains</name>
   <url>http://gis-01/ArcGIS/rest/services/MAP_DOCS/dmww_water_server/MapServer/23</url>
   <expressions>
    <expression alias="Material,Diameter and Install Date" textsearchlabel="Search Material:" isvaluerequired="false">
     <values>
      <value prompt="Material" field="MATERIAL" usedomain="true" isvaluerequired="false" >MATERIAL = '[value]' </value>
      <value prompt="Diameter" field="DIAMETER" usedomain="true" isvaluerequired="false" operator= "AND" > DIAMETER = '[value]'</value>
      <value prompt="Example: 01/01/2007 Install Date" field="INSTALLDATE" isvaluerequired="false" operator= "AND" > INSTALLDATE >= '[value] 00:00:00'</value>
     </values>
     </expression>
    </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select Water Mains</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>water mains</titlefield>
   <fields all="true">
    <field name="DIAMETER" gridfield="true" />
    <field name="FACILITYID" gridfield="true" />
    <field name="MATERIAL" gridfield="true" />
    <field name="INSTALLDATE" gridfield="true" dateformat="MM/DD/YYYY" useutc="true" />
   </fields>

So in the above case I would like to search for material, diameter and date,  but maybe next time just material and date??  Is this possible??
Also - I cant seem to get the �??add to selection set�?� to work?  Thanks in advance for your help on these issues.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Marie,

   So in Version 3.0 there is some issue you are going to have to work around. You need to use uniquevalsfromfield instead of domain as using domain in 3.0 will force you to have a value for each domain field. The next issue you will have to Just deal with in version 3.0 is that once you have chosen a value from the dropdown list the search will automatically be executed (this was fixed in latter releases). I am going to assume that your diameter field is numeric and not a string and I adjusted your expression for that assumption.

Here is a corrected configuration for your layer:

        <layer>
            <definitionexpression></definitionexpression>
            <enableexport>true</enableexport>
            <name>Water Mains</name>
            <url>http://gis-01/ArcGIS/rest/services/MAP_DOCS/dmww_water_server/MapServer/23</url>
            <expressions>
                <expression alias="Material,Diameter and Install Date" textsearchlabel="Search Material:" isvaluerequired="false">
                    <values>
                        <value prompt="Material" uniquevalsfromfield="MATERIAL" isvaluerequired="false">MATERIAL = '[value]'</value>
                        <value prompt="Diameter" uniquevalsfromfield="DIAMETER" isvaluerequired="false" operator="AND">DIAMETER = [value]</value>
                        <value prompt="Example: 01/01/2007 Install Date" isvaluerequired="false" operator="AND">INSTALLDATE >= date '[value] 00:00:00'</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Water Mains</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>FACILITYID</titlefield>
            <fields all="false">
                <field name="DIAMETER" gridfield="true" />
                <field name="FACILITYID" gridfield="true" />
                <field name="MATERIAL" gridfield="true" />
                <field name="INSTALLDATE" gridfield="true" dateformat="MM/DD/YYYY" useutc="true" />
            </fields>
            <links/>
            <zoomscale usegeometry="true" zoompercent="1.6"></zoomscale>
            <autoopendatagrid>false</autoopendatagrid>
            <queryattachments>false</queryattachments>
            <relates/>
            <symbology>
                <simplelinesymbol color="0x00ff00" alpha="0.8" width="2" />
            </symbology>
        </layer>
0 Kudos