Select to view content in your preferred language

flex popup number formatting

4707
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
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>


You added/didn't remove the / terminating the field tag. The format statement is a child of the field tag, so you can't terminate the parent. Just remove the slash in red and should get rid of that error.

R_
0 Kudos
JoshuaChan
Deactivated User
Sorry, can you explain. I don't understand. I thought I had copied Robert's version of the script verbatim. I'd attached my xml to the previous post. Can you tell me what needs to be removed? Robert's had 2 lines in red and I'm assuming you didn't mean to remove 2 lines of code.

I tried removing </field> and that removed the popup error HOWEVER the original problem still remains - I still have commas in my number: 19,990,131



I had a typo in my config statement that Robert fixed in his post.  The format statement is a child of the field tag, so you can't terminate the parent.  Just remove the slash in red and should get rid of that error.

R_
0 Kudos
AnthonyGiles
Honored Contributor
Joshua,

Is your code exactly the same as what Robert posted as that should work with no errors:

<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>

Regards

Anthony
0 Kudos
RhettZufelt
MVP Notable Contributor
I believe the issue is here: (notice only the / is red)

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


Should be:

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


Notice I removed the / from the end of the <field> tag (after visible="true"). Putting that slash there tells it that the <field> tag is closed, so it can't assign the "child" format tag to it.
removing that / keeps it open, then it will assign the format to that field tag, then you close the field with </field>

I tried removing </field> and that removed the popup error HOWEVER the original problem still remains - I still have commas in my number: 19,990,131 


Since you are closing the field tag on the original line, the format was being seen as it's own element (not a child), then the </field> tag was no longer associated with an open field tag as it was already closed on the original line. Thus the error, trying to close something that isn't "open".

Notice there is not </field> for the items that don't require formatting (or other child tags) as the / at the end closes it.

Hope this clarifies it for you,

R_
0 Kudos
JoshuaChan
Deactivated User
That did the trick. Thanks everyone!
0 Kudos