Select to view content in your preferred language

flex popup number formatting

4703
14
02-26-2013 03:52 PM
JoshuaChan
Deactivated User
I noticed that the popup configuration for numbers defaults to 000,000,000
but for my data I want it just to show up as 000000000
is there any way to change the number format in the popup? there's nothing obvious in the configuration window.
Tags (2)
0 Kudos
14 Replies
RhettZufelt
MVP Notable Contributor
Sure, just use the usethousandsseparator in your field tag.

Here is an example for my Shape_Area field that displays without any of the commas.


        <field name="Shape_Area" alias="Area of Feature" visible="true">
             <format precision="0" usethousandsseparator="false"/>


More here:  http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Pop_up_configuration_files/01m3...

R_
0 Kudos
JoshuaChan
Deactivated User
Sorry, I've only used the GUI.
Where do I find this configuration file to add these tags?  Is it accessible via the GUI? Or do I have to find it on the server here the flex viewer resides?




Sure, just use the usethousandsseparator in your field tag.

Here is an example for my Shape_Area field that displays without any of the commas.


        <field name="Shape_Area" alias="Area of Feature" visible="true">
             <format precision="0" usethousandsseparator="false"/>


More here:  http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Pop_up_configuration_files/01m3...

R_
0 Kudos
JoshuaChan
Deactivated User
I think I found the files. I made the changes I'm guessing are necessary based on your sample. But I don't see the changes. I tried refreshing the browser. I tried closing and re-opening ArcGIS Viewer for Flex. Is there something else I'm missing?

See code below. I'm just trying to change PRIORITY_DATE to have no commas.



<?xml version="1.0" ?>
<configuration>
    <fields>
        <field name="TPOD_TAG" alias="TPOD_TAG" visible="true"/>
        <field name="STRM_NAME" alias="STRM_NAME" visible="true"/>
        <field name="STATUS" alias="STATUS" visible="true"/>
        <field name="LICENCE_NO" alias="LICENCE_NO" visible="true"/>
        <field name="PRIORITY_DATE" alias="PRIORITY_DATE" visible="true"/>
 <format precision="0" usethousandsseparator="false"/>        <field name="LIC_STATUS" alias="LIC_STATUS" visible="true"/>
        <field name="PURPOSE" alias="PURPOSE" visible="true"/>
    </fields>
    <showattachments>false</showattachments>
    <showrelatedrecords>false</showrelatedrecords>
</configuration>




Sorry, I've only used the GUI.
Where do I find this configuration file to add these tags?  Is it accessible via the GUI? Or do I have to find it on the server here the flex viewer resides?
0 Kudos
RhettZufelt
MVP Notable Contributor
I don't use the GUI, but I figure it would be in the configure section for popups and the key/value pair tab.  http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Configuring_pop_ups_in_Applicat...


The format statement I gave you is for a number field.  Is your PRIORITY_DATE field a date field or just a number (or, is your service public to test?)?

The fields section on this link http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Pop_up_configuration_files/01m3...  shows the avialable format options.

R_

Ultimately, the change needs to be in the popup folder in your flexviewer folder on the server (which I suspect AppBuilder does for you).  So, for windows using IIS, would be something like \inetpub\wwwroot\FlexViewer_Map\popups\Popup_layer.xml
0 Kudos
JoshuaChan
Deactivated User
Unfortunately the GUI doesn't have any options for output format in the same way that ArcExplorer Online does. Or at least it's not easily found by me yet. I've found the "popup" folder and made the changes as you've shown but I don't see any change in my flex app. it still shows the commas between the 000,000,000.

The PRIORITY_DATE in the original dataset was set as a Number (Long) field.

Unfortunately our service is internal only which is strange because the data is actually public, but because this is a pilot project, they've made all the services internal only. The original dataset can be downloaded here: http://goo.gl/2XM5E





I don't use the GUI, but I figure it would be in the configure section for popups and the key/value pair tab.  http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Configuring_pop_ups_in_Applicat...


The format statement I gave you is for a number field.  Is your PRIORITY_DATE field a date field or just a number (or, is your service public to test?)?

The fields section on this link http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Pop_up_configuration_files/01m3...  shows the avialable format options.

R_

Ultimately, the change needs to be in the popup folder in your flexviewer folder on the server (which I suspect AppBuilder does for you).  So, for windows using IIS, would be something like \inetpub\wwwroot\FlexViewer_Map\popups\Popup_layer.xml
0 Kudos
JoshuaChan
Deactivated User
oops sorry. I sent you the link to the wrong dataset. It's this one : http://goo.gl/oDRIK
the other one is missing the PRIORITY_DATE field.


Unfortunately the GUI doesn't have any options for output format in the same way that ArcExplorer Online does. Or at least it's not easily found by me yet. I've found the "popup" folder and made the changes as you've shown but I don't see any change in my flex app. it still shows the commas between the 000,000,000.

The PRIORITY_DATE in the original dataset was set as a Number (Long) field.

Unfortunately our service is internal only which is strange because the data is actually public, but because this is a pilot project, they've made all the services internal only. The original dataset can be downloaded here: http://goo.gl/2XM5E
0 Kudos
ScottMcGee
Regular Contributor
I think the problem is that you put the formatting tags outside of the field name tag. Try one of these instead:

<field name="PRIORITY_DATE" alias="PRIORITY_DATE" visible="true" format precision="0" usethousandsseparator="false"/>

-or try this:

<field name="PRIORITY_DATE" alias="PRIORITY_DATE" visible="true" precision="0" usethousandsseparator="false"/>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Guys,

    The  format tag is child of a field tag (not an attribute).
Documentation here:
http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Pop_up_configuration_files/01m3...

Joshua,

   Currently in App Builder 3.1 there is no way to apply formatting to fields.

   Here is your data with the formatting you were attempting applied properly:

<configuration>
    <fields>
        <field name="TPOD_TAG" alias="TPOD_TAG" visible="true" />
        <field name="STRM_NAME" alias="STRM_NAME" visible="true" />
        <field name="STATUS" alias="STATUS" visible="true" />
        <field name="LICENCE_NO" alias="LICENCE_NO" visible="true" />
        <field name="PRIORITY_DATE" alias="PRIORITY_DATE" visible="true">
            <format precision="0" usethousandsseparator="false" />
        </field>
        <field name="LIC_STATUS" alias="LIC_STATUS" visible="true" />
        <field name="PURPOSE" alias="PURPOSE" visible="true" />
    </fields>
    <showattachments>false</showattachments>
    <showrelatedrecords>false</showrelatedrecords>
</configuration>
0 Kudos
JoshuaChan
Deactivated User
I tried that edit but I got an error message:
Map Manager: A problem occurred while parsing the configuration file popups/PopUp_1.xml
Error #1085

[ATTACH=CONFIG]22415[/ATTACH]

my xml file is below:
<?xml version="1.0" ?>

<configuration>
    
     <fields>
        
          <field name="TPOD_TAG" alias="TPOD_TAG" visible="true"/>
        
          <field name="STRM_NAME" alias="STRM_NAME" visible="true"/>
        
          <field name="STATUS" alias="STATUS" visible="true"/>
        
          <field name="LICENCE_NO" alias="LICENCE_NO" visible="true"/>
        
          <field name="PRIORITY_DATE" alias="PRIORITY_DATE" visible="true"/>
 
               <format precision="0" usethousandsseparator="false"/>
          </field>        
          <field name="LIC_STATUS" alias="LIC_STATUS" visible="true"/>
        
          <field name="PURPOSE" alias="PURPOSE" visible="true"/>
    
     </fields>
    
     <showattachments>false</showattachments>
    
     <showrelatedrecords>false</showrelatedrecords>

</configuration>






Guys,

    The  format tag is child of a field tag (not an attribute).
Documentation here:
http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Pop_up_configuration_files/01m3...

Joshua,

   Currently in App Builder 3.1 there is no way to apply formatting to fields.

   Here is your data with the formatting you were attempting applied properly:

<configuration>
    <fields>
        <field name="TPOD_TAG" alias="TPOD_TAG" visible="true" />
        <field name="STRM_NAME" alias="STRM_NAME" visible="true" />
        <field name="STATUS" alias="STATUS" visible="true" />
        <field name="LICENCE_NO" alias="LICENCE_NO" visible="true" />
        <field name="PRIORITY_DATE" alias="PRIORITY_DATE" visible="true">
            <format precision="0" usethousandsseparator="false" />
        </field>
        <field name="LIC_STATUS" alias="LIC_STATUS" visible="true" />
        <field name="PURPOSE" alias="PURPOSE" visible="true" />
    </fields>
    <showattachments>false</showattachments>
    <showrelatedrecords>false</showrelatedrecords>
</configuration>
0 Kudos