Enhanced-Search-Widget-for-FlexViewer Part III

115869
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
JavierCruz_Lugo
New Contributor II
Hello everybody! Sorry if my question is repeated, but I don´t find the answer.

I have a map service with subtypes, for example:

CODE   DESCRIPTION
0    - Rumbo
1    - Foliacion
2    - Fractura medida
3    - Fracutra vertical
...

And I want that the user can write in the text box something like : "fractura" and the widget shows both restults: "Fractura medida" AND "Fractura vertical", this is, that the widget search also by Description, this is possible??

I tried with: usesubtype="true" in my <value> inside <expression> but it seems it doesn´t works or probably I´m doing something wrong. This is my query, I know that I search only by the code with that, maybe there is the mistake: TIPO = [value]

Thank you for read me and I'll be waiting any response.

Regards!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Javier,


  Subtype descriptions are only used when displaying the results. The decsription does not come into play when doing the actual search as that description is not the actual value that is stored in the database record.
0 Kudos
JavierCruz_Lugo
New Contributor II
Robert thank you for your response, I´ll think for other solution 🙂

Regards!
0 Kudos
BenPeterson
New Contributor
I've got everything working except being able to arrange my fields from a resulting search. I've narrowed it down to an issue with double quotes being in the sde table name. <fields all="true"> works and displays all the desired results. <fields all="false"> with the desired arrangement works for fields from a non-related table. When I add fields from the related table, the xml is invalid because of the quotes in the middle of the string. My sde table naming convention is similar to the following:

sqldatabasename."domain\owner_name".tablename.fieldname

It is my understanding the related fields I wish to add and format have to contain the full path name. This results in the following code string:

<field name="sqldatabasename."domain\owner_name".tablename.fieldname" alias="Field Name" gridfield="true"/>

The problem becomes that the field name has quotes inside of quotes, which is an xml code error. Are you aware of any work aroundfor this issue? I have searched the esri forums and google to no avail. I have attached a capture of the endpoint and the code. In the code I have commented out the offending field names and it works like this, of course minus the fields I commented out.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ben,

   Have you tried using single quotes for the name attribute?
<field name='sqldatabasename."domain\owner_name".tablename.fieldname' alias="Field Name" gridfield="true"/> 
0 Kudos
BenPeterson
New Contributor
Yes, I have tried single quotes and no (extra) quotes at all, as well as switching single and double quotes. I tried double, double quotes and the &quot command for xml. Also tried brackets and parenthesis. I finally got an error saying invalid sql statement. It may not be xml formatting but sql causing the problem.

Still working on it but I figure I'm out of luck on this one short of recreating the sql database using sde instead of the dbo. Not worth the effort for that since fields all=true works. It just not as pretty.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ben,

  I always thought it strange that esri will prevent you from creating a field name with special characters like that but they do it themselves...
0 Kudos
MarkHuffman
New Contributor III
I have already customized the widget with generous help from Robert (see here:   http://forums.arcgis.com/threads/109735-eSearch-widget-combine-graphical-search-apply-buffer-and-int...). Now I want to do a little more. Is there a way to replace the drop down list in the graphical search tab with text? My widget only searches one layer and selects features within a buffer in one other layer. Currently, the dropdown shows both layers, based on what is in the configuration XML. True, the desired layer is on top and selected by default, but my customer does not want to see the other layer. 

Thank you. 

Mark


My solution was to make the dropdown controls invisible by adding the code to do that at the end of the init() function.

                           }
                            configSearchText[0].symbology = lyrSymbol;
                            fFeatLayer.renderer = new SimpleRenderer(lyrSymbol);
                        }
                    }
                }
    
    cboLayerText.visible=false;
    selectionMethodText.visible=false;
    
            }
            
            /**
             * Return an array of unique field names.
 
0 Kudos
WarwickAttree
New Contributor

Hi Robert, Is it possible to allow for multiple Vars in the search URL, I see you allow for one, R1..

Is there away to add a second Var, R2 ?

Thanks

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Warwick,

    Where would the second var be used? Can you give me a more detailed example or workflow?

0 Kudos