Select to view content in your preferred language

searchwidget want default to be text, not graphical search

1297
6
08-10-2010 04:37 AM
PeterHoffman
Deactivated User
I am trying to get the searchwidget default to be text search, not graphical search. I have changed the index in the searchwidget.mxml code but the icons then select the opposite search type - text for graphical and visa/versa. Is there a more elegant way of doing this?
Thanks,
Tags (2)
0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Peter.

  Just add a selectedindex attribute to the viewstack in the mxml code.
0 Kudos
PeterHoffman
Deactivated User
Robert,

I modified code to add it, but graphical mode is still default.:

private function showStateGraphicalSearch(event:MouseEvent):void
   {
    WidgetEffects.flipWidget(this, viewStack, "selectedIndex", 0, 400);
   }
  
   private function showStateTextSearch(event:MouseEvent):void
   {
    WidgetEffects.flipWidget(this, viewStack, "selectedIndex", 1, 400);
   }

<mx:ViewStack id="viewStack" width="100%" height="100%" selectedIndex="1" creationPolicy="all" paddingTop="4">
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Peter,


   You mentioned you switched the viewstacks order around did you set that back to original? I know that this works as I am doing it in my code and have helped several people with this same issue.
0 Kudos
PeterHoffman
Deactivated User
Yes, after trying several things I set the code back to the original code.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Peter,

  You can try to to set the viewStack.selectedIndex = 1; at the very end of the init function also. It sounds like your changes are not getting built though.
0 Kudos
PeterHoffman
Deactivated User
I got it to work with your suggestion. I forgot I had added another line of code recommended by another coder. After taking out that line it works as desired.
Thank for your quick help.
0 Kudos