Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

136417
767
10-25-2010 02:13 PM
RobertScheitlin__GISP
MVP Emeritus
All Here is my next widget in the FlexViewer 2.1 series

Special thanks to Erwan Caradec for contributing to this code.

The Enhanced Search Widget extends the standard search widget with a floating data grid and a new spatial query w/buffering.

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e
Tags (2)
0 Kudos
767 Replies
KennethMorris
Emerging Contributor
Robert,

I found your previous post regarding an edit to the MXML very helpful and easy to execute as far as implementing the code.

When I went forward and attempted to compile the code I ran into some issues.

I found this video helpful (https://www.youtube.com/watch?v=25uC2e3LsLk&feature=player_embedded) in laying out the basic steps for compilation, but after adding the edited MXML as a module I ran into multiple errors that appeared in two major groups;

1) 1120: Access of undefined property SearchWidget. SearchWidgetFloatDG.mxml /Modified/src/widgets/eSearch line 752 Flex Problem (~4 errors)

2) 1046: Type was not found or was not a compile-time constant: SearchWidget. SearchWidgetFloatDG.mxml /Modified/src/widgets/eSearch line 752 Flex Problem (~5 errors)

Any suggestions you have as to tackling this issue would be greatly appreciated.

- Rick



Rick,

   There is no configuration option for disabling certain graphical search button as you have figured out but you can simply locate the MXML Group with the id of graphicalInput and add:

visible="false"
                          includeInLayout="false"
to the particular mx images (graphical Search Buttons) that you do not want shown. Make sure you don not try this for the eDrawBtn or the pBufferBtn to disable those just set them to false in the SearchWidget.xml

<enabledrawgraphicbutton>false</enabledrawgraphicbutton>
    <enablebuffergraphicbutton>false</enablebuffergraphicbutton>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Kenneth,

     Your issue is that the source path is hard coded many time in the code so the fact that you have the widgets path as /Modified/src/widgets/eSearch instead of src/widgets/eSearch is a big issue. Try making the suggested code changes to the code in the original location instead.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

    Domains that are attached to sub types will be fixed in the eSearch version 2.5 due to release in conjunction with the Flex Viewer 2.5 (coming very soon).
0 Kudos
KenCarrier
Deactivated User
Robert,

Thank you very much, I will be anxiously awaiting the release of the Flex 2.5 API. Do you think this will happen before the end of the year?

Ken,

    Domains that are attached to sub types will be fixed in the eSearch version 2.5 due to release in conjunction with the Flex Viewer 2.5 (coming very soon).
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   Yes 2.5 is on schedule for before the end of year so far.
0 Kudos
KenCarrier
Deactivated User
Great thank you very much. Once it gets released and I have had time to upgrade my app and widgets I will get back with you on the results. Thank you again for your contributions to the community we greatly appreciate all the help!
0 Kudos
KennethMorris
Emerging Contributor
Kenneth,

     Your issue is that the source path is hard coded many time in the code so the fact that you have the widgets path as /Modified/src/widgets/eSearch instead of src/widgets/eSearch is a big issue. Try making the suggested code changes to the code in the original location instead.


Robert,

Thank you for your quick response yet again.

When I am importing the source code for Flex 2.4 as a project into Flash Builder it automatically prompts me import a new copy of the project / extract project to folder x.

This was "Modified" as seen above or "FlexViewer" as I have tried in subsequent attempts, and it appears that this file path is the source of the problem with the hardcoding that you previously mentioned.

How do I avoid this issue and implement the code changes in the original location as you had previously suggested?

Thanks again for your assistance,

Kenneth
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Kenneth,

   Here are some steps you can follow:

1) Copy the contents of the flexviewer-2.4-src folder (i.e .settings, html-template, libs, locale, src, etc)
2) Create a "Flash Builder 4.5" folder in the root of your C:\ drive (This is a preference as I don't like my projects buried in my user folder).
3) In Flash Builder File menu choose Switch Workspace > Other and browse to the "Flash Builder 4.5" folder you created in step 2.
4) Back in windows explorer (or my computer) create a folder in the "Flash Builder 4.5" folder and call it "FlexViewer2.4"
5) Paste the contents from step 1 in this folder.
6) In Flash Builder from the File menu choose Import Flash Builder Project... > choose Project folder > Browse and choose the "FlexViewer2.4" folder from step 4 and click finish.
7) When it Asks about what Adobe SDK to use (hopefully you have already downloaded the Adobe 4.1 SDK) choose 4.1. If not then click the "Configure Flex SDK" > "Find and download other versions of Flex SDK" > Download Flex 4 SDKs > Flex 4.1 Update Adobe Flex SDK (169 mb) > once it is downloaded then extract it to C:\Program Files\Adobe\Adobe Flash Builder 4.5\sdks\4.1.0 > back in the prefferences dialog choose Add... > Browse and C:\Program Files\Adobe\Adobe Flash Builder 4.5\sdks\4.1.0 > ok
😎 Copy the eSearch source folder (from the download you did of it) and paste it into the widgets folder.
9) Right click on the FlexViewer2.4 project in the package explorer and choose properties > Flex Modules > Add > Source > Browse > src\widgets\eSearch\SearchWidget.mxml > ok.
10) Repeat the add button and Source > Browse > src\widgets\eSearch\SearchWidgetFixedDG.mxml > ok.

and finally your done.
0 Kudos
SaraRoth
Emerging Contributor
Robert,
I split the Enhanced Search Widget into two different widgets. One has the text search, the other has the graphical search. Everything is working great, except when I try to export the results as a CSV file. For one of the widgets, the fields are now separated by quotation marks instead of being in different columns. The other widget still works great. I believe that this is because its folder name is still "eSearch" and the other widget's folder is now called "eSearch_Text". What changes in the code would I need to make, so that the export function will work correctly for both widgets?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sara,

    Well that is kind of a loaded question as there could be a vast  number of things that have gone wrong... Are you saying that you just copied the widget and set the disablebuttons element in the copies SearchWidget.xml? So much more information is needed for me even have an idea of were to being. Are you using the latest version?
0 Kudos