Resolved - double in dropdown - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Resolved - double in dropdown

Last post 01-04-2005 12:04 AM by Coita Thierry. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-29-2004 08:04 AM

    Resolved - double in dropdown

    Hi this message is for one of the best: Greg Collins

    You have posted this solution for don't have double in dropdown:

    Let's say you have a drop-down list box that is populated from a
    repeating table in your main data source. And it is specifically using
    my:field1 as the value in the repeating table.


    You would put a filter on the drop-down list box with the following
    expression:


    . = not(. = preceding::my:field1)


    I know that looks funny, but basically what this filter does is to say
    that if the drop-down list already has an option with the value trying
    to be added (while the list is being built), then don't add it. This
    makes it so that you have only unique values in your drop-down list.


    --
    Greg Collins [InfoPath MVP]
    Please visit:http://www.InfoPathDev.com


    I try to put your example on my example put that don't work.

    I do that:
    I have a listbox (State) I have bind to an xml:

    <Cities>
    <City state="Washington">Redmond</City>
    <City state="Washington">Seattle</City>
    <City state="California">Los Angeles</City>
    <City state="La Sagne">La Chaux-de-Fonds</City>
    <City state="Florida">Orlando</City>
    </Cities>


    my content of parameter to populate is:

    Connexion: cities

    Entry: /Cities/City/@state[. = not(. = preceding::my:state)]

    value: .
    Name: .

    But when I start my form I have always two times washington on my dropdown.

    I have make a mistake? What do you think?

    Thanks for your answer

    ++


    Every moment hesitated is a moment gone for life!!! Think it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 12-30-2004 05:12 AM In reply to

    Re: Resolved - double in dropdown

    Ok I have found my mistake.

    entry had to like this:
    Entry: /Cities/City/@state[. = not(. = ../preceding::City/@state)]

    My mistake a little bit supid but...

    ++

    Every moment hesitated is a moment gone for life!!! Think it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 01-03-2005 02:47 PM In reply to

    Re: Resolved - double in dropdown

    Glad you got it fixed!

    Just a side note... I've since learned that you do not need the first .= in the XPath... You can shorten the XPath like this:

    Entry: /Cities/City/@state[not(. = ../preceding::City/@state)]


    Greg Collins [InfoPath MVP]
  • 01-04-2005 12:04 AM In reply to

    Re: Resolved - double in dropdown

    Hi

    Thanks for your correction


    ++

    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.