Geeks With Blogs

Tangible Thoughts SharePoint, MOSS? and all the other questions

OK if some of you were wondering how you could put in the New Item for DVWP’s toolbar here is the code.

<TD class="ms-toolbar">

<table cellpadding="1" cellspacing="0" border="0" MsoPnlId="data">

<tr>

<td nowrap=""><LocID ID="L_NewItem"/><a tabindex="2" ID="diidIONewItem" class="ms-toolbar" title="New" ACCESSKEY="N" href="{$URL_New}" onclick="javascript:NewItem('{$URL_New}', false);javascript:return false;" target="_self"><img src="/_layouts/images/newitem.gif" ID="tbbuttonstart1" alt="New" border="0" width="16" height="16"/></a><a tabindex="2" ID="diidIONewItem" class="ms-toolbar" ACCESSKEY="N" href="{$URL_New}" onclick="javascript:NewItem('{$URL_New}', false);javascript:return false;" target="_self"><LocID ID="L_NewItem">New Item</LocID></a></td>

</tr>

</table>

</TD>

You will need to have the following xsl variables defined

<xsl:param name="PageUrl"/>

<xsl:param name="URL_New"/>

And bound to the following CAMLVariables

<ParameterBinding Name="PageUrl" Location="Postback;Connection;CAMLVariable"/>

<ParameterBinding Name="URL_New" Location="Postback;Connection;CAMLVariable"/>

The key here is that the New item page should take the form of {$URL_New}?Source={$PageUrl}, so you might even be able to escape with <a href=”{$URL_New}?Source={$PageUrl}”>New Item</a>

Posted on Friday, March 4, 2005 12:39 PM SharePoint | Back to top


Comments on this post: New Item for a DVWP

# re: New Item for a DVWP
Requesting Gravatar...
smahing tip but do you know how to do this in 2007 ?

Cheers

s
Left by sifry on Jul 02, 2008 11:04 PM

Your comment:
 (will show your gravatar)


Copyright © Tariq | Powered by: GeeksWithBlogs.net