Used xd:preserve, now table rows don't appear - InfoPath Dev
in

InfoPath Dev

Used xd:preserve, now table rows don't appear

Last post 06-07-2010 06:36 AM by Jimmy. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-04-2010 02:22 AM

    Used xd:preserve, now table rows don't appear

    Hello -

    I've used xd:preserve to change the font size and colour of the "Insert Item" link under a repeating table. The repeating table has two fields, a drop down and a text field.

    The Insert Item text is working as it should be, but the fields have disappered from the table row. You can still add more rows, but they're all blank.

     Here is the code:

     Table:

    </tbody><tbody xd:xctname="RepeatingTable">
                <xsl:for-each select="my:Case_Details/my:Issue">
                 <tr style="MIN-HEIGHT: 26px">
                  <td style="BORDER-BOTTOM: #000000 1pt; BORDER-LEFT: #000000 1pt; BORDER-TOP: #000000 1pt; BORDER-RIGHT: #000000 1pt">
                  <div>

                          <xsl:apply-templates select="my:Type_of_Issue_dropdown" mode="xd:preserve"/>

                  </div>
     
                  </td>
                  <td style="BORDER-BOTTOM: #000000 1pt; BORDER-LEFT: #000000 1pt; BORDER-TOP: #000000 1pt; BORDER-RIGHT: #000000 1pt"><span hideFocus="1" class="xdTextBox" title="" tabIndex="0" xd:CtrlId="CTRL68" xd:xctname="PlainText" xd:binding="my:Other">
                    <xsl:attribute name="style">WIDTH: 100%;<xsl:choose>
                      <xsl:when test="my:Type_of_Issue != &quot;Other&quot;">DISPLAY: none</xsl:when>
                     </xsl:choose>
                    </xsl:attribute>
                    <xsl:value-of select="my:Other"/>
                   </span>
                  </td>
                 </tr>
                </xsl:for-each>
               </tbody>

     

    Then the template:

    <xsl:template match="my:Type_of_Issue_dropdown" mode="xd:preserve">
     <select style="WIDTH: 100%" class="xdComboBox xdBehavior_Select" title="" size="1" xd:CtrlId="CTRL71" xd:xctname="dropdown" xd:binding="my:Type_of_Issue" xd:boundProp="value" value="" tabIndex="0">
                    <xsl:attribute name="value">
                     <xsl:value-of select="my:Type_of_Issue"/>
                    </xsl:attribute>
                    <xsl:choose>
                     <xsl:when test="function-available('xdXDocument:GetDOM')">
                      <option/>
                      <xsl:variable name="val" select="my:Type_of_Issue"/>
                      <xsl:if test="not(xdXDocument:GetDOM(&quot;Case Type&quot;)/dfs:myFields/dfs:dataFields/dfs:Case_Type[@Column1=$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(&quot;Case Type&quot;)/dfs:myFields/dfs:dataFields/dfs:Case_Type">
                       <option>
                        <xsl:attribute name="value">
                         <xsl:value-of select="@Column1"/>
                        </xsl:attribute>
                        <xsl:if test="$val=@Column1">
                         <xsl:attribute name="selected">selected</xsl:attribute>
                        </xsl:if>
                        <xsl:value-of select="@Column1"/>
                       </option>
                       
                                               </xsl:for-each>
                     </xsl:when>
                     <xsl:otherwise>
                      <option>
                       <xsl:value-of select="my:Type_of_Issue"/>
                      </option>
                     </xsl:otherwise>
                    </xsl:choose>
                   </select>
    </xsl:template>

     

    Can anyone see what the problem might be?

     TIA

  • 06-07-2010 06:36 AM In reply to

    Re: Used xd:preserve, now table rows don't appear

    I'm confused by what you mean by this:

    The Insert Item text is working as it should be, but the fields have disappered from the table row. You can still add more rows, but they're all blank.

    Aren't new new rows in a repeating table typically blank?  Do you mean the values in the rows can't be edited?  I'm not 100% sure, but I think it may be the case that you can't have bound controls inside an xd:preserve section.   xd:preserve essentially acts as a DO NOT TOUCH zone to InfoPath, which can be a good thing and a bad thing.

    With Qdabra's qRules, you can add a button to your form, style it however you like, and then set it up to add new rows to your repeating group when clicked.  Might that be a solution to your issue?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.