Select to view content in your preferred language

Esearch Widget - Popup and Results Window Records

4666
17
Jump to solution
10-29-2012 11:08 AM
MegPeterson
Regular Contributor
Hi all -

Is it possible to show different records in the results and popup windows using the Esearch Widget? I'd like to show just one or two fields in the results window, but then show all 10 fields in the popup window, including any attachments.  The xml Robert provided is helpful with showing or not showing on the datagrid etc, but was wondering if I'm missing a popup component.

Thanks, Meg
Tags (2)
0 Kudos
17 Replies
MegPeterson
Regular Contributor
Oh, that's great. I love how there are so many options behind the scenes for doing things, though sometimes I feel I'll never finish a project because I just keep tweeking them constantly!

Now I'm thinking about combining my data though based on this thread. Question for you - when you click on your map after searching and zoomeing with the combined file, are the popups being fired from the config.xml file like this: 
<!--
<layer label="Demographics" type="tiled" visible="false" alpha="0.5"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Median_Household_Income/MapServ...">
                <sublayer id="1" popupconfig="popups/PopUp_Demographics_BlockGroups.xml"/>
                <sublayer id="2" popupconfig="popups/PopUp_Demographics_Tracts.xml"/>
                <sublayer id="3" popupconfig="popups/PopUp_Demographics_Counties.xml"/>
                <sublayer id="4" popupconfig="popups/PopUp_Demographics_States.xml"/>
-->
or from Robert's eSearch?

Are you able to export all the records from your combined file, even though that file is not visible on the map?

Thanks, Rhett!
0 Kudos
MegPeterson
Regular Contributor
More on this.

in the eSearchWidget.xml I have <disablebuttons>grid,spatial,datagrid,graphic</disablebuttons> set.

also, along with disabling the showStateResult, I moved the loader up to the text area as per here:

http://forums.arcgis.com/threads/64335-eSearch-disable-Results-state?p=223600#post223600

This way, I only have the text search options and no other icons across the top.  The loader function shows the spinner while loading, then, after load is done, it gives you the total number selected but you never navigate away from the initial search box so are ready for the next search.

[ATTACH=CONFIG]18867[/ATTACH]

R_


Ah! Great. I didn't see this earlier. I like this much better than my big empty blank window.

When you're disabling the showStateResult in the .mxml, are you just commenting out every single one you find?
0 Kudos
RhettZufelt
MVP Notable Contributor
Know what you mean about constant tweaking.  Not to mention one has to keep incorporating the "enhancements"

Yes, I have my main service with the point, line, and poly datasets loaded in the map and visible as such:

   <layer label="Post-closure" type="dynamic" visible="true" alpha="1.0"
      url="http://gis01.wch-rcc.com/ArcGIS/rest/services/SDCV_custom/post_closure/MapServer">
      <sublayer id="2" popupconfig="popups/PopUp_wastepolys.xml"/>
      <sublayer id="0" popupconfig="popups/PopUp_wastepoints.xml"/>
      <sublayer id="1" popupconfig="popups/PopUp_wastelines.xml"/>
   </layer>


My nightly script (as my data is dynamic) will put a small buffer on the points and lines, then combine with the polygon layer.  I have MANY items with the same ID (segments of a line, etc) so I then dissolve the buffer layer on my SITECODE field and make a single multipart shape for each SITECODE.  that way, I will have one and only one value for each sitecode to search on, regardless of the number of features that actually comprise that SITECODE set.  This is the layer that I will now search against.

I don't even have to load that service in the map, just specify the feature in the eSearchWidget.xml as the URL.
However, I did have to disable the calls showHighlight and infoWindow functions in the mxml for both the searchWidget and the FixedDG mxml.  This keeps it from using a eSearch popup and instead grabs the popup configured in the config.xml as above (get weird results if I try to use the eSearch popups as they "point to" the centroid of the buffer polygon.  Since I have combined a bunch of pipelines, etc, the centroid isn't always actually ON a feature).

So, when I do a search, it finds all the "buffered" features that match my criteria and zooms to the extent as well as showing the selection by highlight color (I see now I need to increase my point buffer size as they are not "around" the points, they fall on top of it and hard to see).  Since I also have the actual point,line,poly data loaded and visible, the highlight color appears to be "outlining" the data, when I click, the popup comes from the config.   It also populates the datagrid with all the attributes from the "buffer" layer.  I have different needs for each, the search/datagrid shows the information common to all features in that SITECODE, so a multipart works great.  However, when I click on the feature, it actually pulls the popup so I can get info from each "individual" feature in that SITECODE (line segment lenth, current status of that segment, etc.)

So, I get the data from my combined buffer layer in the DG (which is what I want as I only need one entry per SITECODE) and then if I click on an individual feature, I get the info from the config.xml popup, and I have it set to not display any fields on the popup if the value is blank or null.

Hope this is clear, include a snapshot that has most everything visible in it (the line points and polys that meet search have small "selection" color around them, the one I clicked on has larger selection).

[ATTACH=CONFIG]18892[/ATTACH]


R_
0 Kudos
RhettZufelt
MVP Notable Contributor
Commenting out all the calls to it that I find.  Don't know if they are "all" needed, but for this map, I don't ever want them.

something like this: 
    if(!disGrid){
     wTemplate.addTitlebarButton(ICON_URL + "i_table.png", resultsLabel, showStateResults);
    }


I just comment out the entire "if" statement.

and I change these showStateResults(); to //showStateResults(); for all I find EXCEPT the actual "private function showStateResults():void".  I don't mess with that one, just the "calls" to it.

R_
0 Kudos
RhettZufelt
MVP Notable Contributor
The one thing I don't like is that any time I either clear or close the eSearchWidget (and does not do this with any of the other widgets), it also closes my popup that comes from the config.  Even if I click on a feature "before" I even open the eSearchWidget, when I clear or close the search widget, the popup closes also.

Have not figured out where/how to "disable" this yet.

OK, figured it out.  Just need to comment out the correct calls to hideInfoWindow();  (I just disabled the function with   //map.infoWindow.hide();  )  Not sure if it breaks something else as I have not fully tested, but seems to be working fine.

R_
0 Kudos
MegPeterson
Regular Contributor
You've given me some good ideas! It's helpful to see how people set up their projects. I think I'm going to try the combined file option (!egads!) - but your notes are very helpful.

I have a unrelated question for you...I'm feeling like a knob for something that seems simple:

After I click the search button on Robert's widget, I'd like the mouse to revert back to the pan tool so I can scoot around the map and see the selected points. It currently stays with the action to select more features.

I think I need to do something to the function queryFeaturesGra(), along the lines of navTool.activate. That once a graphic search is excuted, the mouse changes to pan.

Any chance you know?
0 Kudos
RhettZufelt
MVP Notable Contributor

After I click the search button on Robert's widget, I'd like the mouse to revert back to the pan tool so I can scoot around the map and see the selected points. It currently stays with the action to select more features.

I think I need to do something to the function queryFeaturesGra(), along the lines of navTool.activate. That once a graphic search is excuted, the mouse changes to pan.

Any chance you know?


from the eSearchWidget documentation:

<keepgraphicalsearchenabled>true</keepgraphicalsearchenabled>

The keepgraphicalsearchenabled element is a Boolean that specifies whether or not 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. To
unselect/disable the current graphical search tool all you have to do is clear your selection. Default is false if
not specified.

Robert included an option for that in the config.  Set to false, this should do it for you,

R_
0 Kudos
MegPeterson
Regular Contributor
Did you hear my eyes roll? That was painfully simple and obvious. Thanks...
0 Kudos