Configuring pop-ups in ArcGIS Viewer for Flex 3.0

2534
5
11-27-2012 12:07 PM
by Anonymous User
Not applicable
Re: configuring pop-ups in 3.0:

I'm under the impression that it's best to choose to configure the pop-up using either:
1) the Application Builder via the <description> tag -- I like this option because I can format my text using the HTML tags, OR
2) the XML <configuration> -- I like this option because I can use numeric and date formatting tags on FIELD values.

I cannot see examples of how to either:
1) format date or number FIELDS within the <description> tag, OR
2) format non-field text without the <description> tag

Following an example here, I can create the pop-up via the XML file, using <description> and <field> tags, like this:
<configuration>    
 <title>Prioritized Tracts</title>    
 <description><![CDATA[
  <br><i><b>Name:</b></i>  {TRACTNAME}  
  <br><i><b>GIS Acres:</b></i>  {GIS_ACRES} 
  <br><i><b>Salesforce:</b></i>  <a href="{SALESFORCE_URL}"> (Link) </a><br>]]></description>  
  <fields>
   <field name = "GIS_ACRES">    
    <format usethousandsseparator="true"/>    
    <format precision="0"/>   
   </field> 
  </fields>
</configuration>


BUT, if I then view the code inside the Application Builder, all my field formatting gets deleted from the XML (everything below </description>)... this seems risky since I move between App Builder and configuration files.

It seems safer to choose either <description> or <configuration>, rather than mixing the two, but I don't know how to do all the formatting I need using either option.

Any advice is welcome.

Oh, and my pop-up doesn't seem complicated, I need to be able to do these things:

Name: Green Acres (bold/italics formatting on the left-hand column names)
Acres: 2,550  (bold/italics formatting, and the FIELD needs precision and thousandsseparator formatting on its value)
Date Protected: 2/3/2010  (bold/italics formatting, and the FIELD needs date formatting on its value)
Tags (2)
0 Kudos
5 Replies
JasonNielsen
Occasional Contributor
Re: configuring pop-ups in 3.0:

I'm under the impression that it's best to choose to configure the pop-up using either:
1) the Application Builder via the <description> tag -- I like this option because I can format my text using the HTML tags, OR
2) the XML <configuration> -- I like this option because I can use numeric and date formatting tags on FIELD values.

I cannot see examples of how to either:
1) format date or number FIELDS within the <description> tag, OR
2) format non-field text without the <description> tag

Following an example here, I can create the pop-up via the XML file, using <description> and <field> tags, like this:
<configuration>    
 <title>Prioritized Tracts</title>    
 <description><![CDATA[
  <br><i><b>Name:</b></i>  {TRACTNAME}  
  <br><i><b>GIS Acres:</b></i>  {GIS_ACRES} 
  <br><i><b>Salesforce:</b></i>  <a href="{SALESFORCE_URL}"> (Link) </a><br>]]></description>  
  <fields>
   <field name = "GIS_ACRES">    
    <format usethousandsseparator="true"/>    
    <format precision="0"/>   
   </field> 
  </fields>
</configuration>


BUT, if I then view the code inside the Application Builder, all my field formatting gets deleted from the XML (everything below </description>)... this seems risky since I move between App Builder and configuration files.

It seems safer to choose either <description> or <configuration>, rather than mixing the two, but I don't know how to do all the formatting I need using either option.

Any advice is welcome.

Oh, and my pop-up doesn't seem complicated, I need to be able to do these things:

Name: Green Acres (bold/italics formatting on the left-hand column names)
Acres: 2,550  (bold/italics formatting, and the FIELD needs precision and thousandsseparator formatting on its value)
Date Protected: 2/3/2010  (bold/italics formatting, and the FIELD needs date formatting on its value)


Under your fields tag add the following and change it to your data. Make sure to keep it false for visible and pick your dateformat you want but i think you are looking for shortDate.

If you have that field for example INSTALLDATE in your description tag it will format the date using whatever you specified, for example shortDate.
   
<field name="INSTALLDATE" alias="Install Date" visible="false">
        <format dateformat="shortDate"/>
    </field>


It has worked for me and should work for you as well.
0 Kudos
by Anonymous User
Not applicable
Under your fields tag add the following and change it to your data. Make sure to keep it false for visible and pick your dateformat you want but i think you are looking for shortDate.

If you have that field for example INSTALLDATE in your description tag it will format the date using whatever you specified, for example shortDate.
   
<field name="INSTALLDATE" alias="Install Date" visible="false">
        <format dateformat="shortDate"/>
    </field>


It has worked for me and should work for you as well.


Yes, I can format the date using various dateformat tags within the <fields> section.  But, my question is about trying to get all the formatting I need in within the <description> tag... and about moving between the Application Builder and the configuration file.

If you view the pop-up you describe via the Application Builder, all the <field> formatting will be deleted -- or, at least that's what happens to me; maybe there is a way I can prevent this?
0 Kudos
JasonNielsen
Occasional Contributor
Not the best approach maybe, but you could try this.

I don't use the application builder but once you have the majority of the xml created with the builder you can go to that file on your computer or network and add in the formatting of the fields in to the xml with notepad or some other program. Save your changes, and then just right click and make the file read only and that should stop Application builder from modifying or deleting your information.  Of course you can't modify the file in application builder or notepad till you right click and uncheck the read only. But it should allow you to get it done and move on to other things.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Katie,

   Actually most of these issue you are having will be addressed in 3.1 of App Builder as it is suppose to support both fields and description elements. Just hang tight till next month some time (estimated release).
0 Kudos
by Anonymous User
Not applicable
Okay thanks Robert, I will wait!
0 Kudos