Select to view content in your preferred language

Help with Enhanced Search Widget, Viewer, customization questions

4942
20
Jump to solution
09-19-2012 08:45 AM
MichelleKinseth
Emerging Contributor
Hello,
Last week I inherited a Flex Viewer that was built by someone else several (~6?) months ago, then put aside. When I was given the viewer I was also given a short list of customization's desired by the viewer owner, and so I'm trying to accommodate his requests. The viewer is built on Flex 2.5, and the Enhanced Search v2.x is the main functionality of the viewer. I have downloaded the recent upgrades for both but haven't been able to make the upgrade yet, mainly because the person who worked on this before me did some editing in some of the mxml files and so trying to track changes made in some of those files has been quite burdensome; honestly I'm not sure what in the new code are updates versus what were changes made by my predecessor; but that's something I'll have to figure out. The eSearch widget should be a bit simpler to upgrade, I hope.

My issues are thus:
1. The owner of the viewer does not want a popup to show when a search is completed in the eSearch widget. I've read some threads here that have mentioned commenting out things such as Highlight and/or MouseOver Events and I've tried several combinations of those various possibilities but nothing has worked. Any hints here would be very helpful and very much appreciated. (there are no popups enabled in the main config). Disabling the popup is a primary desire of the viewer owner so if nothing else, I'd really like to accomplish this for him.

2. The owner of the viewer does not want the search results to show in the widget "window", either. As the widget functions now, when a search is completed the results appear in the fixed table at the bottom of the map, in the search widget window, and in the popup (when activated). This is a redundancy of information for our particular use and the owner wants only for the results to appear in the fixed table. Is this possible? I feel comfortable making some changes to the compiled code if I am given some guidance because as it is I have no idea where to start. If this is not possible, that is fine too - I will happily tell the viewer owner that I can't do this for him.

3a. Is there any way to have the map open with a set of features selected (meaning symbolized as "highlighted" when the map initializes) as if the features had been selected from the search widget? The viewer displays water data, so features that aren't relevant to a user are shown along with the ones they are interested in and not until they perform a search with the widget can they tell which ones are applicable to their issue. Does that make sense? I have a feeling this one might not be possible, but I wanted to ask those who know more than I.

3b. Conversely, is there a way to disable selecting features that do not contain the url parameter (or part of it) that zoomed the map (the parameter is a unique ID to identify specific features as well as to define extent)?

4. I was asked to embed the Layer List and eSearch Widget into a sidebar of the viewer so they aren't "floating" above the map. I know there must be existing code for this functionality but I can't seem to find it in the help section.  

Please keep in mind that until last week I had never opened Flash Builder or seen the compiled code of a Flex viewer before (or any compiled code at all) though I've done a lot of xml editing. I am not a developer at all, but if given a path to follow I can usually suss out code through forums and help doc's. Sadly, ESRI has not helped me much with these particular tasks so now I'm asking for help! Three days of staring at this while randomly changing things without a real clue as to where to start is long enough, I think.

Thank you in advance for any help anyone can give me on any of these issues.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Michelle,

   Yes first order of business it to get to version 3.x for both the viewer and the eSearch Widget.

Maybe "quite involved" was to strong. It would require you to comment out a line of code in two mxmls (hopefully that is all of them).
In the eSearchWidget.mxml you would need to find the mouseOverSearchResult function and comment out this line:
hitimer = setTimeout(showHighlight, 300, [ searchResult ]);


In the SearchWidgetFixedDG.mxml you would need to find the onItemRollOver function and comment out:

showInfoWindow2(searchResult);


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:

View solution in original post

0 Kudos
20 Replies
RobertScheitlin__GISP
MVP Emeritus
Michelle,

   To being with I will have to say I really don't want to provide help for doing this in an old version such as 2.4 if there is no real need for you to be that far behind the power curve (3.1 is coming in a couple of months). If you can start with Flex Viewer 3.0 than you will not be wasting a bunch of time (not sure if this is what you meant when you said you downloaded the recent upgrades).


  1. So do not want popups at all? This could be quite involved.

  2. Removing the search results from the widget altogether would be virtually a complete re-write of the widget... You can stop the widget from switching to the results view once the search is completed. You would search for the showStateResults in each of the search functions like queryFeaturesText and queryFeaturesGraphical.

  3. a & b: Using the url search will allow of this. There is pretty good documentation on this Enhanced Search Widget URL Search Configuration.pdf

  4. Sidebars... Hmm... No there is nothing OTB for this (sort of). It would be possible to set the right attribute of the map to 300 or something and have the eSearch and layer list widget fixed in that space using left, right, top, bottom attributes.

0 Kudos
MichelleKinseth
Emerging Contributor


  1. So do not want popups at all? This could be quite involved.

  2. Removing the search results from the widget altogether would be virtually a complete re-write of the widget... You can stop the widget from switching to the results view once the search is completed. You would search for the showStateResults in each of the search functions like queryFeaturesText and queryFeaturesGraphical.

  3. a & b: Using the url search will allow of this. There is pretty good documentation on this Enhanced Search Widget URL Search Configuration.pdf

  4. Sidebars... Hmm... No there is nothing OTB for this (sort of). It would be possible to set the right attribute of the map to 300 or something and have the eSearch and layer list widget fixed in that space using left, right, top, bottom attributes.



Robert-
Thanks for the reply. I definitely understand your caution regarding the version I am working with. I am attempting an update to Flex 3.0 today (looks like I actually have 2.5 now), so fingers crossed that goes smoothly...

1. You are correct, I, or rather the viewer owner, don't want popups at all. I'm not sure what you mean by quite involved - like extensive editing of the compiled code? If so, I'll happily tell him it might not be cost effective for me to spend the time figuring it out.

2. Stopping the widget from switching to results would accomplish the goal, basically the viewer owner doesn't want the results to show so however that happens is okay. I will search for those lines of code you mentioned and give that a try. Thank you!!

3. I will look that documentation over again.

4. ah, yes. I can "fake" it with those attributes. Thank you for reminding me of that.

Thanks for the response. In your opinion I should upgrade both the Viewer and widget before pursuing these edits, I assume.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Michelle,

   Yes first order of business it to get to version 3.x for both the viewer and the eSearch Widget.

Maybe "quite involved" was to strong. It would require you to comment out a line of code in two mxmls (hopefully that is all of them).
In the eSearchWidget.mxml you would need to find the mouseOverSearchResult function and comment out this line:
hitimer = setTimeout(showHighlight, 300, [ searchResult ]);


In the SearchWidgetFixedDG.mxml you would need to find the onItemRollOver function and comment out:

showInfoWindow2(searchResult);


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:

0 Kudos
MichelleKinseth
Emerging Contributor
Michelle,

   Yes first order of business it to get to version 3.x for both the viewer and the eSearch Widget.



Thanks Robert.

I'm wondering if maybe you (or anyone) has any idea as to why, when I bring the new Flex 3.0 code into Flash Builder I get over 80 errors all related to the src/com/esri/viewer path? I have no idea what the problem is; all I did was unzip and open a new project with the new code (I also added the appropriate .swc file). I've done no edits, copy/pasting of xmls, or mxml editing. Any ideas? The older version I was using worked fine, though the organization of the com/esri/viewer was structured differently. I've been using Flash Builder (yes, I have SDK 4.6) for four days and I still don't understand much of it's functionality so it's entirely possible this is user error as this is my first time setting up a new project. I'm just not sure where to look for more solutions. I'm abandoning this task for the day, and will resume tomorrow. When hopefully I can also attempt to address the other solutions you provided me above.

thanks.
Michelle
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Michelle,

  In Flash Builder there is a project menu and a Clean... command run that and see if it resolves the errors.
0 Kudos
MichelleKinseth
Emerging Contributor
Michelle,

  In Flash Builder there is a project menu and a Clean... command run that and see if it resolves the errors.


Thanks for the tip, Robert. I ran Clean... but it didn't fix my errors. I shall have to do a bit more investigating.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Michelle,

   Can you post a screen shot of the errors?
0 Kudos
MichelleKinseth
Emerging Contributor
Michelle,

   Can you post a screen shot of the errors?


[ATTACH=CONFIG]17852[/ATTACH] [ATTACH=CONFIG]17853[/ATTACH]

and there are more that wouldn't fit on the screen - all 1046
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Michelle,

   So you are sure that you added the agslib-3.0-2012-06-06.swc to the libs folder?
0 Kudos