Select to view content in your preferred language

Popup formatting dates and numbers in FlexViewer 2.3

5104
15
04-19-2011 11:33 AM
JosVroegop
Deactivated User
I am looking for information on how to use date and number formatting in the flexviewer's 2.3 popups.
There is one example that uses the date formatter but i can't seem to get it to work in my own popups. Can anyone help me out? Thanx in advance.
Tags (2)
0 Kudos
15 Replies
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
JosVroegop
Deactivated User
Thanks, i found what i was looking for. I added an example.

<fields>
<field name="Number" " visible="true">
        <format precision="3"/>
        </field>
<field name="Date" visible="true">
        <format dateformat="DD-MM-YYYY"/>
        </field>
</fields>
0 Kudos
JonFisher
Emerging Contributor
I've been having trouble turning off the thousand separator. I'm using the syntax:
<field name="TR_IFMS_ID" alias="Tract ID"  visible="true">
         <format useThousandsSeparator="false"/>
        </field>

But the field is still showing up with the thousand separators. Any tips?
0 Kudos
MehulChoksey
Esri Contributor
try all lowercase and note single s after thousand.  usethousandseparator
0 Kudos
JonFisher
Emerging Contributor
try all lowercase and note single s after thousand.  usethousandseparator


Thanks, I had the extra s and capitalization since that's what the API page lists. I changed it to:
  <field name="TR_IFMS_ID" alias="Tract ID"  visible="true">
         <format usethousandseparator="false"/>
        </field>

But it's still displaying the comma thousand separators (see attached). Can others get this to work properly? The field is esriFieldTypeDouble in case that makes a difference. I never had this problem with thousand separators until the 2.3 upgrade.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jon,

   The thousands separator is a bug.

   If you are one that is using the FlexViewer source code than you can fix the BUG that is causing this.

In the MapManager.mxml line 980.

is Currently (BUG):

pFieldInfo.format.useThousandsSeparator = fields.format.@usethousandseparator;


needs to be (FIX):

pFieldInfo.format.useThousandsSeparator = fields.format.@usethousandseparator == "true";
0 Kudos
JonFisher
Emerging Contributor
That fixed it, thanks so much!
0 Kudos
DerekHunter
Emerging Contributor
Wondering correct use of this for use in FeatureTooltip widget.  My date field for given date (6/8/2011) displays as 1307491200000.  Below is the xml for the widget.

<configuration>
<layers>
        <layer>
            <name>Crime</name>
            <fields>Crime_Date,PD_ID,Street,Description</fields>
        </layer>
    </layers>
</configuration>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Derek,

   I don't do any special formatting of returned values in this widget and esri returns date field values for REST as a UTC number.
0 Kudos