Select to view content in your preferred language

Modifying the Score text in the Locate Widget of Flexviewer 2.4

1494
8
11-22-2011 09:02 AM
by Anonymous User
Not applicable
Original User: RedmondGIS

I want to add text where it says "score" to make it more clear that this is an address matching score. See attached image.

I am using the LocateWidget_US.xml and do not think I can do it here. I think the place to do it may be in the LocateWidget.mxml in this line????

locateResult.content = getDefaultString("resultScoreText") + " " + (addrCandidate.score % 1 == 0 ? addrCandidate.score : addrCandidate.score.toFixed(1));
0 Kudos
8 Replies
by Anonymous User
Not applicable
Original User: rscheitlin

Paul,

   You are correct. GetDefaultString is a function the viewer used to get a localized string for the users language.
0 Kudos
by Anonymous User
Not applicable
0 Kudos
PaulFerro1
Deactivated User
the change made to the code is causing the tool to not function properly, results do not display.

Do I need to add  "Address Matching "+ getDefaultString to every instance of  the GetDefaultString function?

or just here:
 //labels for the "results" tab
                loadingLabel = configXML.labels.loadinglabel || getDefaultString("loadingLabel");
                locationsLabel = configXML.labels.locationslabel || getDefaultString("locationsLabel");
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

Paul,

   I have no problem using this line of code:

locateResult.content = "Address Matching " + getDefaultString("resultScoreText") + " " + (addrCandidate.score % 1 == 0 ? addrCandidate.score : addrCandidate.score.toFixed(1));
0 Kudos
PaulFerro1
Deactivated User
When I used that same line of code, compile and run my application it runs fine in http://localhost/flexviewerdebug/index.html

I then grab the LocateWidget.swf file from \wwwroot\flexviewerdebug\widgets\Locate and replace the orginal .swf file in my application. (I've also grabbed the entire Locate folder and replaced)

Is this the correct workflow?

Also, I am using the LocateWidget_US.xml with this modified code:
<?xml version="1.0" ?>
<configuration>
    <locator>http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Streets_US/GeocodeServer</locator>
    <minscore>40</minscore>
 <fields><field name="State" defaultvalue="OR" visible="false"/></fields>
    <zoomscale>10000</zoomscale>
</configuration>


Here is an example of how the results do no show up:
[ATTACH=CONFIG]11340[/ATTACH]
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

Paul,

  That is pretty weird... Is your production machine's Flex Viewer version the same as the one you have on your development machine? Your work flow sounds fine. Did you clear your browsers cache, and try hitting the production server from another machine?
0 Kudos
PaulFerro1
Deactivated User
Robert,

I am working with flexviewer 2.5 and the un-compiled code for 2.5 in Flashbuilder 4.5.  I have hit the site from multiple machines and still have the same issue, but when I run it from my development machine it works.

Which leads to believe something else is being compiled when the entire application is deployed, and if I use the deployed flexviewer app (instead of just replacing my locate widget) and replaced all my xmls and config. that it would then work. But I really do not want todo that.

Is this the recommended work flow? To have it all configured with modified xmls then compile and deploy through Flashbuilder? I have just been modifying individual widgets and replacing the ones in the compiled flexviewer.



Paul
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

Paul,

   Yes, the work flow that I always use is build all my changes to widgets in the FlexViewer version I am using and copy ALL the files from the bin-release folder over to the production server. Just make a backup copy of what you have currently on your production server that way you can go back if to much gets screwed up.
0 Kudos