logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

compact-repeat header bug in ui.xsl : fix: msg#00059

Subject: compact-repeat header bug in ui.xsl : fix
I've noticed that the header containing labels for a compact repeating
group is incorrect if some of the repeating controls do not have labels.

For example, the following compact repeat will render a two column table
with the '2nd column label' label displayed above the *first* column.

   <xforms:repeat id="test-repeat" bind="bind-test-repeat"
appearance="compact">
   
    <xforms:input xforms:bind="bind1"/>
    
    <xforms:input xforms:bind="bind2">
     <xforms:label>2nd column label</xforms:label>
    </xforms:input>
   </xforms:repeat>

The fix, in ui.xsl :

replace
                <!-- ***** build header ***** -->
                <xsl:for-each select="xforms:group[1]/*/xforms:label">
                    <xsl:variable name="label-class">
                        <xsl:call-template name="labelClasses"/>
                    </xsl:variable>
                    <td id="{../@id}-label" class="{$label-class}">
                        <xsl:apply-templates
select="self::node()[not(name(..)='xforms:trigger' or
name(..)='xforms:submit')]"/>
                    </td>
                </xsl:for-each>

with 

                <!-- ***** build header ***** -->
                <xsl:for-each select="xforms:group[1]/*">
                    <xsl:for-each select="xforms:label">
                        <xsl:variable name="label-class">
                            <xsl:call-template name="labelClasses"/>
                        </xsl:variable>
                        <td id="{../@id}-label" class="{$label-class}">
                            <xsl:apply-templates
select="self::node()[not(name(..)='xforms:trigger' or
name(..)='xforms:submit')]"/>
                        </td>
                    </xsl:for-each>
                    <xsl:if test="not(xforms:label)">
                        <td id="{../@id}-label" class="label">
                            &#160;
                        </td>
                    </xsl:if>
                </xsl:for-each>

Note that the nested for-each is only used to change context to the
label node, so that the labelClasses template works with the correct
node.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click


<Prev in Thread] Current Thread [Next in Thread>