Display Drop Down List's name and value - InfoPath Dev
in

InfoPath Dev

Display Drop Down List's name and value

Last post 01-17-2006 08:59 AM by mobcdi. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-17-2006 03:17 AM

    Display Drop Down List's name and value

    Is it possible to display the name and value fields of a drop down list in separate text boxes. I have the values for the ddl coming from the main connection but need to display both values on the infopath form
  • 01-17-2006 05:11 AM In reply to

    Re: Display Drop Down List's name and value

    Hi,

    Welcome on board!

    Yes it's possible! But you need to modify your view.xsl!

    If your ddl is in a section you can make a preserve code block for don't have to modify your view each time that you publish


    Find your ddl in your view it appear like this:
    <select class="xdComboBox xdBehavior_Select" title="" style="FONT-FAMILY: Arial" size="1" xd:xctname="DropDown" xd:CtrlId="CTRL488" xd:binding="func" xd:boundProp="value" value="" tabIndex="0">
    <xsl:attribute name="value"><xsl:value-of select="func"/></xsl:attribute>
    <xsl:choose>
    <xsl:when test="function-available('xdXDocument:GetDOM')">
    <option/>
    <xsl:variable name="val" select="func"/>
    <xsl:if test="not(xdXDocument:GetDOM("getFunction")/dfs:myFields/dfs:dataFields/tns:getFunctionResponse/tns:getFunctionResult/TabEigZb/EigZb[text=$val] or $val='')">
    <option selected="selected">
    <xsl:attribute name="value"><xsl:value-of select="$val"/></xsl:attribute>
    <xsl:value-of select="$val"/>
    </option>
    </xsl:if>
    <xsl:for-each select="xdXDocument:GetDOM("getFunction")/dfs:myFields/dfs:dataFields/tns:getFunctionResponse/tns:getFunctionResult/TabEigZb/EigZb">
    <option>
    <xsl:attribute name="value"><xsl:value-of select="text"/></xsl:attribute>
    <xsl:if test="$val=text">
    <xsl:attribute name="selected">selected</xsl:attribute>
    </xsl:if>
    <xsl:value-of select="kurz"/>
    </option>
    </xsl:for-each>
    </xsl:when>
    <xsl:otherwise>
    <option>
    <xsl:value-of select="func"/> //enter here the second value that you need to display in the ddl
    </option>
    </xsl:otherwise>
    </xsl:choose>
    </select>


    Each time that you modify the entry in your ddl you need to make this one more time! The only possibility for that is make a preserve code block but if you do this you can no longer edit your ddl in infopath design mode

    ++

    Thierry
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 01-17-2006 08:59 AM In reply to

    Re: Display Drop Down List's name and value

    Thanks Thierry
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.