Select to view content in your preferred language

Flexviewer search by text by default

1511
10
11-16-2010 09:55 AM
ChrisOwen
Occasional Contributor
How do you get the search widget to default to the text search rather than the graphic search.
This seems so trivial, but I have not found the solution.
Thanks,
Chris
Tags (2)
0 Kudos
10 Replies
RobertScheitlin__GISP
MVP Emeritus
Chris,

  Are you talking about SFV 1.3 or Flexviewer 2.1

If FlexViewer 2.1 than add
currentState="textInput"
to the viewer:BaseWidget element.

If SFV 1.3 than add
selectedIndex="1"
to the mx:ViewStack
0 Kudos
ChrisOwen
Occasional Contributor
Robert,
I am using FV 2.1 - where in the BaseWidget element is the code supposed to be inserted?
Thanks,
Chris
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Chris,

   it is just an attribute of the BaseWidget element so it does not matter where you put it inside the element.
0 Kudos
ChrisOwen
Occasional Contributor
Still not working for me....
So anywhere inside BaseWidget.as?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Chris,

No you need to add it as a attribute of the viewer:BaseWidget element in your SearchWidget.mxml

Like this:
<viewer:BaseWidget xmlns:esri   ="http://www.esri.com/2008/ags"
       xmlns:fx    ="http://ns.adobe.com/mxml/2009"
       xmlns:s    ="library://ns.adobe.com/flex/spark"
       xmlns:mx    ="library://ns.adobe.com/flex/mx"
       xmlns:mxeffects      ="com.adobe.ac.mxeffects.*"
       xmlns:viewer         ="com.esri.viewer.*"
       xmlns:Search        ="widgets.eSearch.*"
       x="600" y="300"
       currentState="textInput"
       widgetConfigLoaded="init()">
0 Kudos
ChrisOwen
Occasional Contributor
Robert,
Looks like I have version 1.02 - sorry!
I tried the
selectedIndex="1"

in the mx:ViewStack, but it didn't work.
I haven't worked in Flex for awhile, I am behind the times.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Chris,

   This definitely works for me.
<mx:ViewStack id="viewStack" width="100%" height="100%" creationPolicy="all" paddingTop="4" selectedIndex="1">
0 Kudos
ChrisOwen
Occasional Contributor
Robert,
I have attached my code for you to view - do you see any issue of why the darn search by text won't start on default?
Chris
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Chris,

   Based on your code change
selectedIndex="20"
to
selectedIndex="0"
0 Kudos