Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've created a multiple item form in SharePoint Designer 2007. However when I click save only the last row gets updated. I've simplified this down to just a primary key value and an input field yet the problem still remains.

SQL Profiler shows the update command for the last row but it never receives any update comands for the other rows.

Is this a known issue or am I doing something wrong?

Markup as follows

<WebPartPages:DataFormWebPart runat="server" IsIncluded="True" FrameType="None" NoDefaultStyle="TRUE" ViewFlag="0" Title="TurnoverTargetInput" __markuptype="vsattributemarkup" __WebPartId="{F8447B1B-5933-4476-A42D-8F6A0B794878}" id="g_f8447b1b_5933_4476_a42d_8f6a0b794878">
<DataSources>
<asp:SqlDataSource id="TurnoverTargetInput1" runat="server" __designer:commandsync="true" ProviderName="System.Data.SqlClient" ConnectionString="Data Source=HODB03;User ID=dw_editor;Password=cocqbi;Initial Catalog=HOBI01_Stage;" SelectCommand="SELECT * FROM [TurnoverTargetInput] " UpdateCommand="UPDATE [TurnoverTargetInput] SET [Target] = @Target WHERE [TurnoverTargetInputKey] = @original_TurnoverTargetInputKey" OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues"><UpdateParameters><asp:Parameter Name="TurnoverTargetInputKey"/><asp:Parameter Name="Target"/><asp:Parameter Name="original_TurnoverTargetInputKey"/><asp:Parameter Name="original_Target"/></UpdateParameters>
</asp:SqlDataSource>
</DataSources>
<ParameterBindings>
<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</ParameterBindings>
    <datafields>@TurnoverTargetInputKey,TurnoverTargetInputKey;@Target,Target;</datafields> 
<XSL>
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
<xsl:output method="html" indent="no"/>
<xsl:decimal-format NaN=""/>
<xsl:param name="dvt_apos">&apos;</xsl:param>
<xsl:variable name="dvt_1_automode">0</xsl:variable>
<xsl:template match="/">
    <xsl:call-template name="dvt_1"/>
</xsl:template>
<xsl:template name="dvt_1">
    <xsl:variable name="dvt_StyleName">Table</xsl:variable>
    <xsl:variable name="Rows" select="/dsQueryResponse/NewDataSet/Row"/>
    <table border="0" width="100%" cellpadding="2" cellspacing="0">
        <tr valign="top">
            <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
                <th class="ms-vh" width="1%" nowrap="nowrap"></th>
            </xsl:if><th class="ms-vh" nowrap="nowrap">TurnoverTargetInputKey</th><th class="ms-vh" nowrap="nowrap">Target</th>
            </tr>
        <xsl:call-template name="dvt_1.body">
            <xsl:with-param name="Rows" select="$Rows"/>
        </xsl:call-template>
    </table>
    <xsl:call-template name="dvt_1.commandfooter" />
</xsl:template>
<xsl:template name="dvt_1.body">
    <xsl:param name="Rows"/>
    <xsl:for-each select="$Rows">
        <xsl:call-template name="dvt_1.rowedit">
            <xsl:with-param name="Pos" select="concat('_', position())" />
        </xsl:call-template>

    </xsl:for-each>
</xsl:template>
<xsl:template name="dvt_1.rowedit">
    <xsl:param name="Pos" />
    <tr>
        <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
            <td class="ms-vb" width="1%" nowrap="nowrap">
                <span ddwrt:amkeyfield="" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(''))" ddwrt:ammode="edit"></span>
            </td>
        </xsl:if><td class="ms-vb">
            <asp:TextBox runat="server" id="ff71{$Pos}" text="{format-number(@TurnoverTargetInputKey, '#,##0.#;-#,##0.#')}" __designer:bind="{ddwrt:DataBind('u',concat('ff71',$Pos),'Text','TextChanged','',ddwrt:EscapeDelims(string('')),'@TurnoverTargetInputKey')}" />
        </td><td class="ms-vb" style="height: 26px">
            <asp:TextBox runat="server" id="ff35{$Pos}" text="{format-number(@Target, '#,##0.00;-#,##0.00')}" __designer:bind="{ddwrt:DataBind('u',concat('ff35',$Pos),'Text','TextChanged','',ddwrt:EscapeDelims(string('')),'@Target')}" />
        </td>
        </tr>

</xsl:template>
<xsl:template name="dvt_1.commandfooter">
    <xsl:param name="FirstRow" />
    <xsl:param name="LastRow" />
    <xsl:param name="RowLimit" />
    <xsl:param name="dvt_RowCount" />
    <xsl:param name="RealLastRow" />
    <table cellspacing="0" cellpadding="4" border="0" width="100%">
        <tr>
            <xsl:call-template name="dvt_1.formactions" />
        </tr>
    </table>
</xsl:template>
<xsl:template name="dvt_1.formactions">
    <td nowrap="nowrap" class="ms-vb">
        <input type="button" value="Save" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit')}" />
    </td>
    <td nowrap="nowrap" class="ms-vb" width="99%">
        <input type="button" value="Cancel" name="btnCancel" onclick="javascript: {ddwrt:GenFireServerEvent('__cancel')}" />
    </td></xsl:template>
</xsl:stylesheet>   </XSL>
</WebPartPages:DataFormWebPart>
share|improve this question
    
Well I've got it working but not as a multiple item form. By adding it as a view and adding the edit item links to the form I can edit one row at a time which does work. –  Chris Herring Jun 6 '11 at 23:38
    
I don't believe you can update multiple items on the same form without something like datasheet view. –  Alex Angas Aug 29 '11 at 9:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.