Problems displaying multiple fields on Drop Down list - InfoPath Dev
in

InfoPath Dev

Problems displaying multiple fields on Drop Down list

Last post 11-05-2007 03:01 PM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-02-2007 07:16 PM

    • Audrox
    • Not Ranked
    • Joined on 11-03-2007
    • Posts 1

    Problems displaying multiple fields on Drop Down list

    Hi -

    I've been trying to use Greg Collins' suggestions for showing multiple fields on a dropdown list ("Display Multiple Fields in a Drop-Down List Box"), but I can't seem to get it to work.  I'm using Infopath 2003 SP2. 

    I've even tried it using the following simple test form to try to get it work.  The problem I'm having is that, unlike Greg's example, I see multiple lines that have "<xsl:value-of select=" and no matter which I replace with a concatanation of fields, the drop down continues to show only the original field.  Below is the latest version of the view1.xsl file for my simplified test, where I've tried to concantenate some simple text to the end of the drop down and that doesn't even work:

    Clearly I must be missing something...Any advice would be greatly appreciated. 

    <div>Test: <select class="xdComboBox xdBehavior_Select" title="" style="WIDTH: 130px" size="1" xd:CtrlId="CTRL1" xd:xctname="DropDown" value="" xd:boundProp="value" xd:binding="my:testco" tabIndex="0">
          <xsl:attribute name="value">
           <xsl:value-of select="my:testco"/>
          </xsl:attribute>
          <xsl:choose>
           <xsl:when test="function-available('xdXDocument:GetDOM')">
            <option/>
            <xsl:variable name="val" select="my:testco"/>
            <xsl:if test="not(business_units/bus_unit[.=$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="business_units/bus_unit">
             <option>
              <xsl:attribute name="value">
               <xsl:value-of select="."/>
              </xsl:attribute>
              <xsl:if test="$val=.">
               <xsl:attribute name="selected">selected</xsl:attribute>
              </xsl:if>
              <xsl:value-of select="."/>
             </option>
            </xsl:for-each>
           </xsl:when>
           <xsl:otherwise>
            <option>
             <xsl:value-of select="concat(my:testco, 'test')"/>
            </option>
           </xsl:otherwise>
          </xsl:choose>
         </select>

    Am I editing the wrong line of code?  Is there something I need to do to enable the change?

     Thanks!

     

  • 11-05-2007 03:01 PM In reply to

    Re: Problems displaying multiple fields on Drop Down list

    Your close --

    The line you've highlighted is in the <xsl:otherwise/> -- which means that this option gets displayed function-available('xdXDocument:GetDOM') fails (a rare thing).

    Leave that modification that you made, but where you really need to make the change is here:

               <xsl:attribute name="selected">selected</xsl:attribute>
              </xsl:if>
              <xsl:value-of select="concat(., 'test')"/>
             </option>
            </xsl:for-each>

     

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