Enhanced-Search-Widget-for-FlexViewer Part III

116285
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
ErwanCaradec
New Contributor III

Robert,

i don't need to change the standard icon assets path, but i need to have non standard widgets config files paths.

For one application i have more than one set of config files depending on the context, Main config file and widgets config files are stored in a sub folder (ie: configs/context1/, configs/context2/, ...).

Icon paths using WIDGET_URL doesn't work for me, the others using ICON_URL ("assets/images/") which is a relative path too) are working fine.

No problem for me if you don't want to update the source as i can do it myself, but i have no idea if other users use non standard path for config files too.

Erwan

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Erwan,

  So this line of code is expecting the widgets assets to be in the same folder as the widgets config file

config.substring(0,config.lastIndexOf("/")) + "/assets/images/"

So because you are storing your widgets config in a non standard place like config/context2/eSearchWidget.xml, it is looking in config/context2/assets/images. The WIDGET_URL is hard coded before that line of code to be "widgets/eSearch/assets/images/". The code above was added to help for those that did not follow the standard of naming my widget eSearch in their widgets folder. So in your case this line of code is working against you so just comment it out. If you figure out how to make the WIDGET_URL relative to the eSearchWidget.swf instead of the eSearchWidget.xml then I am will be happy to make that change.

0 Kudos
ErwanCaradec
New Contributor III

Robert,

maybe this piece of code coul'd do the job in init() function :

for ( var i= 0; i < this.configData.widgets.length; i++){

    var mainConfigWidget:Object = this.configData.widgets;

    var swfName:String = "/"+this.className+".swf";

    if (mainConfigWidget.url) {

        var widgetUrl:String = mainConfigWidget.url as String;

        if (widgetUrl.indexOf(swfName)>=0){

            WIDGET_URL = widgetUrl.substring(0,widgetUrl.length-swfName.length) + "/assets/images/";

        }

    }

}

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Erwan,

   Thanks I will give it a go and add it to the next version.

0 Kudos
BrentFoster
New Contributor II

I am having an issue when using the URL forwarding capabilities of the esearch widget.  Here is a sample URL that I am using:

https://gisserver01/wellsearch/index.html?esearch=10394758-000&showdatagrid=true

The webmap loads fine, the esearch widget loads fine, and automatically zooms to the selected feature.  But whenever I use any other esearch widgets in this map, they also autopopulate with the initial search parameters.  Is there anyway to disable this?  Thanks again for your hard work Robert, this is a wonderfully useful tool. 

0 Kudos
AaronKreag
Occasional Contributor

I solved this problem by actually just copying the esearch widget and then renaming it. So one would be well search tool and one would be mineral lease search tool. You may want to also look at what ones are set to open automatically at start.

Aaron

Sent via the Samsung Galaxy Note® 3, an AT&T 4G LTE smartphone

0 Kudos
BrentFoster
New Contributor II

I only have the one wellsearch widget set to open on startup, so I'm good there.  I tried copying and renaming the esearch folder to a new folder named 'Searches', and changing the other searches in the main config file to point to the new 'Searches' folder.  It still auto populates the eSearch parameter from the URL.  I attempted renaming the swf and xml files as well, no luck. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brent,

   The widget is functioning as designed. When you use a URL search you want to do more than just zoom to the selected feature(s) so the search keyword is added to the eSearch widget and the results of that search are displayed in the eSearch widget.

But whenever I use any other esearch widgets in this map, they also autopopulate with the initial search parameters.

I only have the one wellsearch widget set to open on startup, so I'm good there.

So I am confused by your initial statement in lieu of your proceeding statement... Are you using more than one eSearch widget in your application?

0 Kudos
BrentFoster
New Contributor II

Thanks for your reply Robert,

I am only using the one eSearch widget, with multiple xml config files.  I tried out the suggestion by Aaron and made a copy of the eSearch widget folder and renamed it, just to see if it would help with the issue.

So the issue I'm having, is that after the initial load of the flex viewer, and zoom to the seleted feature, any search based on any other eSearch xml config file that I run after that, automatically populates the initial specified parameter into the search box and runs the search.  I hope that clarifies things a bit.  

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brent,

I am only using the one eSearch widget, with multiple xml config files.

So how are you changing the XML config file for the eSearch at runtime?

0 Kudos