Thousand separators in pop-up widget

6825
6
Jump to solution
03-11-2015 02:07 AM
SveinungRaheim
Occasional Contributor

I have a problem with a customizied pop-up-widget in flex-viewer version 3.6.

If I use the "Key value"-interface for the pop-up, there is no problem to format a number field. The syntax in the pop-up-xml-file ends up like this:

   <field name="LokalitetID" alias="LokalitetID"/>
       <format usethousandsseparator="false"/>

But I want to use a customized pop-up, where I create i URL based on a fixed syntax combined with an attribute from the dataset. I have done this using the "customized" interface in the configure pop-up-dialog.

The syntax is like this:

<a href="http://www.kulturminnesok.no/content/search?search={LokalitetID}&searchtype=0&county=&municipality=&culture_environment=0&man_em_dating=0&category=&em_art1=&em_category=&em_date=&conservation=&em_old_function=&ext=1&submit=S%C3%B8k">Faktaark Kulturminnesøk</a>

The attribute is {LokalitetID}.

The syntax works, the only problem is that the link gets a thousand-separator that corrupts the URL.

Example of incorrect URL:

"http://www.kulturminnesok.no/content/search?search=134,686&searchtype=0&county=&municipality=&cultu...

I have have highlighted the problem, the "LokalitetID"-attribute is shown with a thousand separator, then the URL fails. If I remove the thousand separator, the URL works perfect!

I have tried to add some formatting in to the URL, but I cant get it to work.

Any suggestions?`Is this possible?

Regards

Sveinung Bertnes Råheim

GIS-consultant

County governor of Nordland

Norway

1 Solution

Accepted Solutions
MattiasEkström
Occasional Contributor III

As Robert wrote this is what I was trying to explain in my last post. To make it a bit clearer, this is an example of how your popup xml could look like:

<?xml version="1.0" ?>

<configuration>

    <title>your title</title>

    <description>

        <![CDATA[<a href="http://vannmiljofaktaark.miljodirektoratet.no/Home/Details/{WaterLocationID}">Faktaark Vannmiljøbasen</a>]]>

    </description>

    <fields>

        <field name="WaterLocationID">

            <format usethousandsseparator="false"/>

        </field>

    </fields>

</configuration>

View solution in original post

6 Replies
MattiasEkström
Occasional Contributor III

I guess you're using the Application Builder? I still prefer working directly with the XML-files, with them it is possible to build your custom interface by using the description tag and still use the field tags to control in what way you want your fields to be displayed. You should be able to combine the two syntaxes you mentioned
I'm not sure how to accomplish this in the Application Builder, but you could try to use you customized version in Application Builder och then add to the XML-file something like:

<fields>

        <field name="LokalitetID">

            <format usethousandsseparator="false"/>

        </field>

</fields>

(put it inside the configuration tag)

SveinungRaheim
Occasional Contributor

Thanks for your suggestion.

I have mostly been using the application builder, but I have also tried

to direct edit the pop-up xml-file in the "pop-up"-folder.

I will give it another try. Ideally, I want to set default for the

application that numbers should be read without thousand

separator-format. Now it seems like the flex viewer do this default.

Sveinung

0 Kudos
SveinungRaheim
Occasional Contributor

I still run into this problem.
I want create a valid URL. The URL crashes because the flexviewer returns the number with a thousand separator. Different URL this time:

<a href="http://vannmiljofaktaark.miljodirektoratet.no/Home/Details/{WaterLocationID}">Faktaark Vannmiljøbasen</a>

The problem is that "WaterLocationID" is a number. It is beiing returned with a thousand separator. And that causes the URL to crash:
This URL is valid:
http://vannmiljofaktaark.miljodirektoratet.no/Home/Details/62009
This URL is invalid:
http://vannmiljofaktaark.miljodirektoratet.no/Home/Details/62,009

So is it a way to place the format rule in the expression in the xml-file that config the popup, or can it be done in the general config for flex viewer?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Sveinung,

So is it a way to place the format rule in the expression in the xml-file that config the popup

  That is exactly what Mattias was showing above in his last post.

0 Kudos
MattiasEkström
Occasional Contributor III

As Robert wrote this is what I was trying to explain in my last post. To make it a bit clearer, this is an example of how your popup xml could look like:

<?xml version="1.0" ?>

<configuration>

    <title>your title</title>

    <description>

        <![CDATA[<a href="http://vannmiljofaktaark.miljodirektoratet.no/Home/Details/{WaterLocationID}">Faktaark Vannmiljøbasen</a>]]>

    </description>

    <fields>

        <field name="WaterLocationID">

            <format usethousandsseparator="false"/>

        </field>

    </fields>

</configuration>

SveinungRaheim
Occasional Contributor

Thank you. I didnt understand how to adress the formatting. I could do it separately for one attribute, but not when put inside an expression.
But this solved it, now it works!
Thanks for the full syntax Mattias!

Sveinung

0 Kudos