Select to view content in your preferred language

ArcGIS Viewer for Flex 3.0 precision formatting issue in Query & Search Widget

1488
4
07-12-2012 12:00 PM
PatRaimondo
Deactivated User
I am using the following .xml for a Query Widget. The result returns a number but the "BMI Pct at High Risk" field does not return a number formatted with precision of 1 (ie. 53.3333). This field is esriFieldTypeDouble. I am having the same problem when using the Search Widget. Any help will be appreciated. Thanks.

<?xml version="1.0" ?>
<configuration label="Query G3F BMI">
    <layer>http://services.arcgis.com/8BKVd7DzccTE7TwW/arcgis/rest/services/FG2012_grd3_female_BMI/FeatureServe...</layer>
    <query>BMI_Percentage_at_High_Risk&gt;50</query>
    <titlefield>District_Name</titlefield>
    <linkfield></linkfield>
    <fields all="false">
        <field name="District_Name" alias="District Name"></field>
        <field name="BMI_Percentage_at_High_Risk" alias="BMI Pct at High Risk" visible="true"><format precision="1"></format></field>
    </fields>
    <filterfield>
    </filterfield>
    <refreshrate></refreshrate>
    <zoomscale>800000</zoomscale>
</configuration>
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Pat,

    There is no such support for formatting as you are attempting:

field name="BMI_Percentage_at_High_Risk" alias="BMI Pct at High Risk"  visible="true"><format  precision="1"></format></field>


If you want to find what is supported than look at the widgets documentation:

http://resources.arcgis.com/en/help/flex-viewer/concepts/01m3/01m30000000t000000.htm

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:
0 Kudos
PatRaimondo
Deactivated User
rscheitlin;214919 wrote:
Pat,


    There is no such support for formatting as you are attempting:

field name="BMI_Percentage_at_High_Risk" alias="BMI Pct at High Risk"  visible="true"><format  precision="1"></format></field>


If you want to find what is supported than look at the widgets documentation:

I've been reading the widget documenation and I am not finding an answer. I am fairly new to this so if there is no support to format the number, I can live with that but if there is another way to format it other than how I am attempting to, please let me know. Thanks for your quick response.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Pat,

   You would either have to get into the code of the uncompiled viewer to do it in ActionScript or you set the percision of that field in the MXD and then republish the map service.
0 Kudos
PatRaimondo
Deactivated User
Robert,
I set the precision (significant digits) to 3 and republished the feature service through ArcGIS Online Subscription Services (AGO SS) but the numbers still return unformatted (ie. 53.333) in the widget results. If I publish a Map Service through AGO SS, I do not have access to the attributes, so that doesn't work. I do not have a server so cannot publish directly and I do not have access to the tools necessary to recompile the uncompiled version (assuming I could get the Action Script to work). Thanks for your suggestions.
0 Kudos