Select to view content in your preferred language

Search Widget questions

2778
4
Jump to solution
11-14-2013 05:38 AM
by Anonymous User
Not applicable
Original User: STwork

I am trying to reconfigure the standard search widget. There are 2 things I'd like to do:

1- I would like to flip the locations of the text search and graphical search buttons so the text search appears to the left of the graphical search.[ATTACH=CONFIG]29110[/ATTACH]

2- I would like to add a Clear button to the results window.[ATTACH=CONFIG]29111[/ATTACH]

Any help in either direction would be appreciated. I'm using ArcGIS Viewer for Flex 3.5 App Builder, Notepad++ and Flash Builder.

Scott
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Scott,

   In the SearchWidget.mxml just swap these lines (around line 312):
Cut line 312 and paste under 316.
                wTemplate.addTitlebarButton(ICON_URL + "i_searchgraphical.png", graphicalsearchLabel, showStateGraphicalSearch);                 if (configSearchText.length)                 {                     wTemplate.addTitlebarButton(ICON_URL + "i_searchtext.png", textsearchLabel, showStateTextSearch);                 }


And around line 1178 add the part indicated in red to the boxMessage:

            <s:HGroup id="boxMessage"                       width="100%"                       includeInLayout="{msgVisible}"                       visible="{msgVisible}">                 <mx:Image id="swfMessage"                           source="assets/images/loader.swf"                           visible="false"/>                 <s:Label id="txtMessage"                          width="98%"                          text=""/>                 <s:Label buttonMode="true" textAlign="right"                          click="clear()"                          fontWeight="bold"                          text="{clearLabel}"                          textDecoration="underline"/>             </s:HGroup>


Be sure to set the initialview tag in the SearchWidget.xml to "text"

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Scott,

   In the SearchWidget.mxml just swap these lines (around line 312):
Cut line 312 and paste under 316.
                wTemplate.addTitlebarButton(ICON_URL + "i_searchgraphical.png", graphicalsearchLabel, showStateGraphicalSearch);                 if (configSearchText.length)                 {                     wTemplate.addTitlebarButton(ICON_URL + "i_searchtext.png", textsearchLabel, showStateTextSearch);                 }


And around line 1178 add the part indicated in red to the boxMessage:

            <s:HGroup id="boxMessage"                       width="100%"                       includeInLayout="{msgVisible}"                       visible="{msgVisible}">                 <mx:Image id="swfMessage"                           source="assets/images/loader.swf"                           visible="false"/>                 <s:Label id="txtMessage"                          width="98%"                          text=""/>                 <s:Label buttonMode="true" textAlign="right"                          click="clear()"                          fontWeight="bold"                          text="{clearLabel}"                          textDecoration="underline"/>             </s:HGroup>


Be sure to set the initialview tag in the SearchWidget.xml to "text"
0 Kudos
by Anonymous User
Not applicable
Original User: STwork

Thanks for the timely response.
I made the changes but not seeing any effect.

Around line 312:
if (configSearchText.length)
                {
                    wTemplate.addTitlebarButton(ICON_URL + "i_searchtext.png", textsearchLabel, showStateTextSearch);
     wTemplate.addTitlebarButton(ICON_URL + "i_searchgraphical.png", graphicalsearchLabel, showStateGraphicalSearch);
                }
                wTemplate.addTitlebarButton(ICON_URL + "i_table.png", resultsLabel, showStateResults);


Around line 1178:
<s:Group id="resultsList"
                 width="100%" height="100%"
                 visible="false"
                 visible.resultsList="true">
            <s:layout>
                <s:VerticalLayout gap="1" paddingTop="4"/>
            </s:layout>
            <s:HGroup id="boxMessage"
                      width="100%"
                      includeInLayout="{msgVisible}"
                      visible="{msgVisible}">
                <mx:Image id="swfMessage"
                          source="assets/images/loader.swf"
                          visible="false"/>
                <s:Label id="txtMessage"
                         width="98%"
                         text=""/>
    <s:Label buttonMode="true" textAlign="right"
       click="clear()"
       fontWeight="bold"
       text="{clearLabel}"
       textDecoration="underline"/>
            </s:HGroup>



After making the changes, I ran in Fb, accepting the save. Cleared my cache before running. I had previously changed the initial view in the xml. I am running Fb on a separate machine than my server. Could that be preventing it from running properly?
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

Scott,

   Hmm... If you are wanting to see the changes to the widget in the Flex Application Builder then you have to overwrite the SearchWidget.swf that the Application Builder is using. Here is where mine is located:

C:\Program Files (x86)\ArcGIS Viewer for Flex\flexviewer\widgets\Search
0 Kudos
ScottThomas1
Regular Contributor
Got my Fb properly set up on my server and now the changes are showing up. Thanks for the help.

Scott
0 Kudos