Drop down returns - InfoPath Dev
in

InfoPath Dev

Drop down returns

Last post 01-31-2008 02:56 PM by oldradio99. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-31-2008 10:45 AM

    Drop down returns

    I have searched this forum high and low. Did you ever know that you used something that works but then you cant remember how you did it? Well that is me right now.

     I have a drop down being populated from a data connection to a simple SQL table. What I want is for the drop down to be blank with no selection when the form opens. Right now it shows the first item in the table. Sort of like the "select one" when you manually populate a drop down.

    It works on all my other forms but I am stumped how I did it.

    Thanks

    Thank you for your Help.

    Art
  • 01-31-2008 01:50 PM In reply to

    You sure you do not have a default set or something?  They typically will start blank. Then you select from the drop down. The field should be blank initially unless you are setting it from somewhere or have a default.  This can get corrupted and if you export your source files you can check the view.xsl. I saw a post recently with the same issue. Try binding to a different field and see if you get the same thing.

  • 01-31-2008 02:56 PM In reply to

    How would I set a default?  Even if I wanted to do that?

    I deleted the data connection and recreated it and updated the ODC connection

     Still same issue, even if binding on a different field

    I also tried creating a brand new form and added a drop down to the same database and same condition.

    I am lost.

    Here is the text form the view.xsl that deals with the drop down.  Could my filters be causing the issue?

    I also opened the template.xsl and when that opened in InfoPath, the drop down behaved normally.

     

     

    - <select class="xdComboBox xdBehavior_Select" title="" style="WIDTH: 100%; FONT-FAMILY: Arial" size="1" xd:CtrlId="CTRL25" xd:xctname="DropDown" xd:boundProp="value" xd:binding="@ItemName" value="" tabIndex="0">

    - <xsl:attribute name="value">

    <xsl:value-of select="@ItemName" />

    </xsl:attribute>

    - <xsl:choose>

    - <xsl:when test="function-available('xdXDocument:GetDOM')">

    <option />

    <xsl:variable name="val" select="@ItemName" />

    - <xsl:if test="not(xdXDocument:GetDOM("tblMMIBuckItems")/dfs:myFields/dfs:dataFields/d:tblMMIBuckItems[not(@ItemName = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/d:tblMMIBucktemsordered/@ItemName)][@ItemName=$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("tblMMIBuckItems")/dfs:myFields/dfs:dataFields/d:tblMMIBuckItems[not(@ItemName = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/d:tblMMIBucktemsordered/@ItemName)]">

    - <option>

    - <xsl:attribute name="value">

    <xsl:value-of select="@ItemName" />

    </xsl:attribute>

    - <xsl:if test="$val=@ItemName">

    <xsl:attribute name="selected">selected</xsl:attribute>

    </xsl:if>

    <xsl:value-of select="@ItemName" />

    </option>

    </xsl:for-each>

    </xsl:when>

    - <xsl:otherwise>

    - <option>

    <xsl:value-of select="@ItemName" />

    </option>

    </xsl:otherwise>

    </xsl:choose>

    </select>

    </font>

    </div>

    </td>

    Thank you for your Help.

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