How to build a custom list form with SharePoint Designer with attachment support
-
Friday, January 12, 2007 4:31 PM
When I Build a custom list form through Sharepoint Designer 2007, I don't have any support for displaying attachments. Of course this list has been enabled for attachments.
I am currently running WSS V3 FR + Sharepoint Designer 2007 FR.
Regards,
Answers
-
Friday, October 12, 2007 8:01 AM
Hi,
We have found out a method in order to hide the Fields without customizing.
Go to Setting->List Settings
Under General Setting tab u will find "Advanced Settings",click on that redirect to a page with "Allow management of content types? " choose "Yes" radio button and say ok.
Once that is done you will find a "ITEM" content type getting visible.
To hide any column click on the "ITEM" link, and click on the column you wish to hide and choose "hidden" radio button and click on OK.
this will hide the column to be listed from the forms(New,Edit and Display)
Thanks
Sowmya
- Marked As Answer by Mike Walsh FINMicrosoft Community Contributor Tuesday, January 05, 2010 7:48 AM
-
Thursday, January 17, 2008 11:16 PM
All I needed to do was hide a few fields that were edited by a workflow in the background. This approach worked perfectly and still allowed the workflow to operate as expected.
Thanks!
Edit: and by "this approach" i mean the solution offered by Sowmya_Ramachandran on page 2. For some reason the quote did not appear.
- Marked As Answer by Mike Walsh FINMicrosoft Community Contributor Tuesday, January 05, 2010 7:48 AM
All Replies
-
Monday, January 15, 2007 11:56 AM
I'm having the same problem and while googling I found out we are not the only one :\
-
Monday, February 19, 2007 9:00 PM
Hi fellows!
I've managed to show the current attachments in the list item, with the following code:
<SharePoint:FormField runat="server" id="ff6{$Pos}" ControlMode="Edit" FieldName="Attachments" />
I've also digged into the HTML/JS of a non-custom list form, and figured out that why the "This form was customized not working with attachment" message is show.
In a non-custom form, the web-part has two sections:
<span id='part1'>
// Web part section
</span><span id='partAttachment'>
// Attachment section
</span>When one clicks in the "Attach File" button, the javascript function hides "part1" and shows "partAttachment", or vice-versa.
I tried to copy part of the HTML code of a non-custom form into my custom form, with no sucess.
If anyone is willing to give a try, please, remember to post your findings!
Regards, Murilo
-
Thursday, May 03, 2007 9:41 PMNotice: the author of this website asserted the Murilo's answer was retrieved from his/her website and/or other forum postings. Said author, going by the nickname of "guruevi", real name unknown, wants to be acknowledged for being the inventor/originator of this code/solution. Acknowledgment his hereby given.
-
Monday, May 14, 2007 4:41 PMHi, guruevi's solution, which I found on his web site, does not work. When clicking 'Attach File', it does bring up the appropriate interface. However, after browsing and selecting a file and clicking 'Ok', I get an 'object required' message and I have to 'cancel' out of the 'Add Attachment' view of the page to continue. The attachment does not save.
-
Monday, June 11, 2007 3:58 PM
Hi, i'm having the same problem. so I cannot save the attachment.
Anyone else has found a solution?
Thanks
-
Tuesday, June 12, 2007 12:46 PMI am the same boat. You would think that by this point in time a solution would have been presented!
-
Friday, June 15, 2007 10:37 PM
I just want to display attachments on the custom Display form.
Can you give me some hints. on that.
-
Thursday, July 05, 2007 3:11 AM
Yoshio Kurtz wrote: Hi, guruevi's solution, which I found on his web site, does not work. When clicking 'Attach File', it does bring up the appropriate interface. However, after browsing and selecting a file and clicking 'Ok', I get an 'object required' message and I have to 'cancel' out of the 'Add Attachment' view of the page to continue. The attachment does not save.
Indeed, currently as it is, his solution seems to be incomplete...
I've continued working on this, and after adding missing tag ID="idAttachmentsRow{$noop}" and some hide-if-no-attachment Javascript, the form looks exactly like the original one. However whenever I click on OK, SharePoint does create the item, but doesn't attach the file...
No error is thrown, SharePoint simply doesn't take whatever is inside "Attachments" into account.
Further on, I've looked inside tag __designer:bind= which can also be found for both "Title" and "Body" (I'm working on a Announcement list...) ; but all my attempts lead me to :
"The data source control failed to execute the insert command."
Has anyone got a single clue on the next move ?
I just can't find enough documentation on __designer:bind and everything that goes along (ddwrt: functions, events to throw, etc.) -
Friday, July 06, 2007 1:04 PMThis forum's topis is using SharePoint Designer, but I decided not to use the buggy program. Through using extra steps with WSS, everything works perfectly. Actually better than we using Designer.
-
Friday, July 06, 2007 1:07 PM
Can I ask you about the solution extra-designer you have found?
Thanks
-
Wednesday, July 11, 2007 3:26 PM
So has anyone already solved this problem?
I have tried and modifed guruevi's solution with an edit form but as has already been said , it doesen't work.
i found out that the attachments are saved in a file in the list: [your list]/attachments/[list item id]/[file].
if you put an attachment here, the list will see the attachment for your item.
I am now thinking of creating a custom attachment upload page and handle the uploading myself( don't know how yet , with codebehind and so on).
If anynone has solved this. pleas post your answer.
Greetings
-
Wednesday, July 11, 2007 7:15 PMNope, so far I've got no luck in tweaking Evi's "solution"...
But good luck Higo !
BTW, if you know anything about __design:bind or any of the ddwrt functions not appearing here (like "databind()" ?), please let me know
-
Wednesday, July 11, 2007 7:39 PM
How frustrating not able to modify a simple page in sharepoint and make it work with all its default features.
I am really surprised the Microsoft has not looked this issue of not being able to activate the "attach files" function with custom layout
Really disappointing
BC
-
Monday, July 23, 2007 7:09 AMAnyone has found a solution?
-
Saturday, July 28, 2007 8:02 AM
Hi,
I am involved in the migration of Lotus Notes to Share Point.After the Migration all the Metadata of Lotus notes are converted as the coulmns in the list.But I wanted only certain fields to be displayed in the NewForm.aspx/EditForm.aspx.
Is there any way we can choose the items to be displayed in the NewForm.aspx/EditForm.aspx, Instead of customizing through Designer.
Thanks
Sowmya
-
Saturday, July 28, 2007 11:09 AM
Hi,
Is .net and MOSS 2007 should be installed in the same server for the development purpose.
Please clarify
Sowmya
-
Monday, August 13, 2007 2:55 PM
I wrote a custom webpart that allows me to display attachments for specific list item on the custom display form.aspx.
-
Monday, August 13, 2007 4:19 PM
I contacted Dustin Miller - regarded as the leading SPD expert - about this topic, and he looked into it and it seems that is the way the product is intended to perform at the current time.
There is no knowledge base article citing this as a bug.
Hopefully, the SPD team will take a look at this and move forward on allowing this functionality in the future.
-- Ben
Poorvesh, I'm sure people would be interested in your web part if you could provide a link to it.
-
Monday, August 13, 2007 4:28 PM
This seems strange, that creating a custom list in SPD and having zero attachment support is the way that this product is intended to perform at the current time. If this is true, then why does the paper clip (to use attachments) appear in the corner of the custom form?
Poorvesh, is your webpart where when click on the item, it will display items in another list based on one common field between them or is that something different?
-
Monday, August 13, 2007 7:57 PM
I have created a workaround for this issue, whether it is something you would want to do at a client's location is for another discussion. Maybe working together we can polish this up more so it is something that everyone would feel comfortable using.
I was surfing some blogs and saw a post where they began the process of creating a workaround, but it only worked for new items, so I gave it some more thought, and this is what I came up with.
Involves the following steps:
1. Create your master list which has all possible columns for your list. Enter some data in each column.
2. Save this list as a list template and do not include content.
3. Create a new list from this list template - and delete the columns you do not want others to have access to. Enter some data in each column - attach a document.
4. Open SPD.
5. Create a new blank .aspx page
6. Link the second list to the first list in SPD in the data source library.
7. Create a dataview webpart on your blank aspx page and bring in your linked data source.
This view will be linked directly to both lists - so you can see items that have been created in both lists at all times.
This way you would have users accessing whichever list they have rights to (can see all columns and add attachments, or can see only a few columns and can add attachments.)
8. You can then provide a link to the aspx page where it is a read-only view of the entire list that combines the two lists.
9. Optional, I brought the path field into the dataview web part and modified the url so it would link to the display form of the item, where you would have the opportunity to edit the item and change the attachment if need be.
With this workaround you are not modifying any of the custom forms associated with the lists, so the attachment functionality will still work.
Like I said, it is a workaround for an issue that hopefully the SPD team will correct.
Let me know your thoughts,
Ben McMann
-
Tuesday, August 14, 2007 7:51 PM
Hey,
Are you still working on the migration stuff? If so, please help me. I have been trying to migrate the applications from notes to Sharepoint and I need help with the migration file: "Microsoft.Exchange.Transporter.Provider.SharePoint.SharePointProvider.xml.smap"
Do you know any resources? I cannot find any on the web.
I know it's off topic, but I am Desperate
.
Bryant Duke
-
Monday, August 20, 2007 3:05 PM
If you click on hyper link for an display. It will take you to my custom displayforms.aspx page and on that page it will display item details and my webpart that will show you all the attachments to that particular list item.
-- Poorvesh
-
Wednesday, August 22, 2007 6:26 AM
My attachments are saved now!
I was using custom form because i want to hide fields...
Since custom form not save attachments, i use the NewForm.aspx.
I order my fields : on the top are those i want to show (10 fields) and on the bottom those i want to hide.
I've found that in the newForm.aspx, the table in which fields are has no id and no name. But it's the only one whose className is "ms-formtable".
Here is my code:
Code Snippetfunction count(){
var tables = document.getElementsByTagName('table');
var classe = null;
var tableCentrale = null;
for(var i=0; i < nb_tables; i++){
classe = tables[i].className;
if (classe == "ms-formtable"){
tableCentrale = tables[i];
}
}
var rows = tableCentrale.rows;
for(var i=10; i <rows.length-1; i++){
rows[i].style.display = "none";
}
}
(Sorry for my english!) -
Wednesday, August 22, 2007 6:55 AM
Hi Robin have U tried Evi's Code?Please don't forget me to update me on the solution for this problem.
Byeeeeeeeee.
-
Thursday, August 30, 2007 3:02 PM
Hi there,
I also have the same problem, but I have a solution for some of you (not myself unfortunatly).
If the only reason you are creating a custom form is to hide som fields I recommend a very neat little tool:
http://www.codeplex.com/spstipsUtilityPack
This tool lets you set the properties of a field that you cannot modify in the regular interface. You can select wheter the field should show in the Display, Edit or New forms, and a couple of more settings.
-
Monday, September 03, 2007 8:59 AM
HI friends,
anyone broke through the attachment problem,Please help me guys if anybody did.
Have a nice day.Bye.
-
Thursday, September 27, 2007 7:42 AM
To display attachments that dissapear in a custom display form:
Simply add a new row in the custom display form and add the following line within that row in the code view.
<SharePoint:AttachmentsField ControlMode="Display" FieldName="Attachments" runat="server" Visible="true"/>- Proposed As Answer by Aaron O Wednesday, June 29, 2011 10:06 PM
-
Friday, October 12, 2007 8:01 AM
Hi,
We have found out a method in order to hide the Fields without customizing.
Go to Setting->List Settings
Under General Setting tab u will find "Advanced Settings",click on that redirect to a page with "Allow management of content types? " choose "Yes" radio button and say ok.
Once that is done you will find a "ITEM" content type getting visible.
To hide any column click on the "ITEM" link, and click on the column you wish to hide and choose "hidden" radio button and click on OK.
this will hide the column to be listed from the forms(New,Edit and Display)
Thanks
Sowmya
- Marked As Answer by Mike Walsh FINMicrosoft Community Contributor Tuesday, January 05, 2010 7:48 AM
-
Tuesday, November 06, 2007 6:53 PM
I opened a support issue with Microsoft product support and found out that this is a known issue and there are currently no plans to fix. Sorry folks.
-
Tuesday, November 06, 2007 11:22 PM
Hi guys,
Someone has posted something that can help you until this problem is solved.
http://geek.hubkey.com/2007/10/upload-file-to-sharepoint-document.html
It's a piece of code wich you can use to upload a file to a document library, but it also works for a custom list(by ignoring a strange error).
You can use this to create a user control wich enables people to upload a file to a folder in a list. Most of you probably already seen(in sharepoint designer) that SharePoint places attachments in a folder inside a list[(Listname]/attachments/[ItemId]/) . if you just use this code to upload the file to that that attachments folder you have an attachment.
One problem though. You have to know the ID of the item to know in wich folder you need to place the attachment. So you can use this for the edit form but i don't know yet how to do this with a new form because you don't have the item ID in a newform.
Maybe you can get the last item id and add one to that to "guess" the next item id( not very good i know).
-
Friday, November 09, 2007 3:49 PM
Ok, after playing with the code from Anonymous post on 22 Aug, I was finally able to get it to work for me.
I had a requirement to hide two fields on my NewForm so that users submitting a request could not change them. I still wanted someone handling the request to be able to edit the form and be able to change those fields.
I made a copy of the default NewForm.aspx file and added the following JavaScript.
Code Block<script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("hideRows");
function hideRows()
{
var pageTables = document.getElementsByTagName('table');
var cName = null;
var formTables = null;for(var i=0; i < pageTables.length; i++){
cName = pageTables[i].className;
if (cName == "ms-formtable"){
formTables = pageTables[i];
}
}
var rows = formTables.rows;
rows[rows.length-2].style.display = "none";
rows[rows.length-3].style.display = "none";
}
</script>This will allow me to hide my last two columns listed for the list, if I wanted to add additional visible columns it was as simple as making sure to change my Column order so that the ones that I wanted to hide were the last two.
Hope this helps someone.
Bill Seagle
-
Saturday, November 10, 2007 6:53 AMOk, guys, trust me on this...
The final word from MS is that this is a known issue, and there will not be any attachment support this release. The incorrect grammar for the error message is also logged as a bug.
Sorry, but that's it. Bitter Coder claims to have built a web part to replace this functionality, however. You can check his post out here. -
Wednesday, November 21, 2007 3:47 PM
In my case, there is one and only one item attached to each list item and for my custom form I do not need the capability to add or delete attachments. I just want to provide a link that displays the existing attachment. Am I still out of luck or is there a solution that does what I need?
-
Wednesday, November 21, 2007 7:47 PM
If your custom form does not need to add or delete attachments, you can just add a new FormField with Display mode and bind it to the Attachments field.
It doesn't matter if there is only one or more files attached to the list item. All attachments will be displayed with the corresponding link to the file.
The code for your form field should be something like this:
Code Block<SharePoint:FormField runat="server" id="ff6{$Pos}" ControlMode="Display" FieldName="Attachments" />
-
Wednesday, November 21, 2007 9:47 PM
Hmm ... I added the code you provided
Code Block<SharePoint:FormField runat="server" id="ff6{$Pos}" ControlMode="Display" FieldName="Attachments" />
and I did the bind to the Attachments field. The resulting code was
Code Block<td>
<SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="Display" FieldName="Attachments" __designer:bind="{ddwrt:DataBind('u',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Attachments')}" />
</td>
But my resulting page displayed nothing so I'm doing something wrong. Can you provide additional guidance?
Thanks,
Tom
-
Friday, November 23, 2007 8:57 AMThank you so much for your valuable suggestion. I am trying to solve the attachment issue in the customized webpart.But from this tips , there is no need for to customize my list.
Once agian thanks'
Deepu Paul
-
Friday, November 23, 2007 9:47 PM
Tom,
Check if the data binding is ok. Make sure that Attachments field is in the DataFields, as highlighted below.
<DataFields>
@Title,Título;@MDS,MDS;@Status,Status;@Responsavel,Responsável;@ResponsavelAprovacaoBudget,Responsável Aprovação Budget;@ResponsavelAprovacaoTecnica,Responsável Aprovação Técnica;@Comentario,Comentário;@ContentType,Content Type;@ID,ID;@Modified,Modified;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;
</DataFields>Also, you don´t need the "__designer:bind" in your form field. Your code should look like this:
<td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="ff8{$Pos}" ControlMode="Display" FieldName="Attachments" />
<SharePoint:FieldDescription runat="server" id="ff8description{$Pos}" FieldName="Attachments" ControlMode="Display"/>
</td>I can mail you my aspx if you need a complete example.
Regards,
Murilo
-
Sunday, November 25, 2007 2:32 PM
Hi Murilo,
Thanks for your continued efforts to help me. The Attachments field was already in the DataFields as you highlighted. And I removed the "__designer:bind" from the form field but when the form is displayed the attachment field is still blank.
Yes. Please email me your aspx code to tscheifler(no_spam)@att.net. Please remove the "(no_spam)" text from the email address shown to derive the actual email address.
I have created a much simpler version of my form just to test the display attachment issue. It does not display the attachment either. The entire code for the simpler form is shown below.
Code Block<%@ Page Language="C#" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="WebPartPages" namespace="Microsoft.SharePoint.WebPartPages" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<html dir="ltr"><head runat="server">
<meta name="ProgId" content="SharePoint.WebPartPage.Document">
<meta name="WebPartPageExpansion" content="full">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Scenario-ID *</title>
</head><body>
<form id="form1" runat="server">
<WebPartPages:DataFormWebPart runat="server" IsIncluded="True" FrameType="None" NoDefaultStyle="TRUE" ViewFlag="0" Title="" ListName="{31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8}" Default="FALSE" DisplayName="" __markuptype="vsattributemarkup" __WebPartId="{23848896-DF42-4F5A-A725-86667B91BB7E}" id="g_9f5ec6b9_1756_46c0_bac3_f81a371ee23b" pagesize="1">
<DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="<View></View>" id="Scenarios2"><SelectParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8"/><asp:Parameter Name="MaximumRows" DefaultValue="1"/></SelectParameters><DeleteParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8"/></DeleteParameters><UpdateParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8"/></UpdateParameters><InsertParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8"/></InsertParameters></SharePoint:SPDataSource>
</DataSources>
<ParameterBindings>
<ParameterBinding Name="ListID" Location="None" DefaultValue="31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8"/>
<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</ParameterBindings>
<datafields>@Scenario_x0020_ID,Scenario-ID;@SubProcess,SubProcess;@Title,Title;@Priority,Priority;@Description,Description;@Access_x0020_Mode,Access Mode;@Setup_x002d_Initialization,Setup-Initialization;@Expected_x0020_Result,Expected Result;@Predecessors,Predecessors;@Internal_x0020__x0028_to_x0020_P,Internal (to PS) Interfaces;@External_x0020__x0028_to_x0020_P,External (to PS) Interfaces;@External_x0020__x0028_to_x0020_P0,External (to Pfizer) Interfaces;@Related_x0020_TDDs,Related TDDs/FDDs;@Load_x0020_Test_x003f_,Load Test?;@Script_x0020_Reviewed_x0020_by_x0,Scenario - SPOC/SME Approved;@Script_x0020_Assigned_x0020_To,Script - Assigned To;@Script_x0020_Draft_x0020_Complet,Script - Final;@Status_x0020_Notes,Status Notes;@ModuleShortName,Module;@ProcessShortName,Process;@First_x002d_Dash,First-Dot;@Second_x002d_Dash,Second-Dot;@Scenario_x002d_Seq,SEQ;@Custom_x002f_Vanilla,Custom/Vanilla;@Need_x0020_Payroll_x0020_run_x00,Need Payroll run?;@ModuleFinalCombo,ModuleFinal;@ID,ID;@ContentType,Content Type;@Modified,Modified;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;</datafields>
<XSL>
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" 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">'</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">RepForm3</xsl:variable>
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
<xsl:variable name="RowLimit" select="1" />
<xsl:variable name="dvt_RowCount" select="count($Rows)" />
<xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
<table border="0" width="100%">
<xsl:call-template name="dvt_1.body">
<xsl:with-param name="Rows" select="$Rows"/>
<xsl:with-param name="FirstRow" select="1" />
<xsl:with-param name="LastRow" select="$RowLimit" />
</xsl:call-template>
</table>
<xsl:call-template name="dvt_1.commandfooter">
</xsl:call-template>
</xsl:template>
<xsl:template name="dvt_1.body">
<xsl:param name="Rows"/>
<xsl:param name="FirstRow" />
<xsl:param name="LastRow" />
<xsl:for-each select="$Rows">
<xsl:variable name="dvt_KeepItemsTogether" select="false()" />
<xsl:variable name="dvt_HideGroupDetail" select="false()" />
<xsl:if test="(position() >= $FirstRow and position() <= $LastRow) or $dvt_KeepItemsTogether">
<xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1">
<xsl:call-template name="dvt_1.rowedit">
<xsl:with-param name="Pos" select="concat('_', position())" />
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template name="dvt_1.rowedit">
<xsl:param name="Pos" />
<tr>
<td>
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="25%" class="ms-vb">
<b>Scenario-ID<span class="ms-formvalidation"> *</span>:</b>
</td>
<td width="75%" class="ms-vb">
<xsl:value-of select="@Scenario_x0020_ID" />
</td>
</tr>
<tr>
<td width="25%" class="ms-vb">
<b>Attachments:</b>
</td>
<td width="75%" class="ms-vb">
<SharePoint:FormField runat="server" id="ff2{$Pos}" ControlMode="Display" FieldName="Attachments" />
<SharePoint:FieldDescription runat="server" id="ff2description{$Pos}" FieldName="Attachments" ControlMode="Display"/>
</td>
</tr>
<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
<tr>
<td colspan="99" class="ms-vb">
<span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="edit"></span>
</td>
</tr>
</xsl:if>
</table>
</td>
</tr>
</xsl:template>
<xsl:template name="dvt_1.commandfooter">
<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>
</form></body>
</html>
-
Wednesday, November 28, 2007 8:48 PM
Hi Murilo,
Yes. Please email your aspx code to me at tscheifler(no_spam)@att.net. Please remove the "(no_spam)" text from the email address shown to derive the actual email address.
Thanks,
Tom
-
Friday, November 30, 2007 2:04 PM
Hi Murilo,
Thank you!!!
The aspx file you mailed me was VERY helpful. After looking through your aspx file in detail and comparing it to my simple test form, I see there are differences. It seems that the key difference is your file contains . So I assume your form is being passed the URL query string parameter ID with a value of the list item that should be displayed.
When I preview my simple test form from SharePoint designer the ID query string parameter does not exist (the url looks like this http://ecf.xxx.com/sites/PeopleSoftUpgrade/testing/Lists/Scenarios/test.aspx). So I added the ParameterBinding statement to my aspx and then manually added the ID querystring parameter to the address in the browser (so it looked like this http://ecf.xxx.com/sites/PeopleSoftUpgrade/testing/Lists/Scenarios/test.aspx?ID=64) and the form then displays the attachment!
The ID query string parameter controls which list item it will display the attachment for. In other words, on my form I have a filter that results in the form displaying data for list item number 64. If I use query string parm ID=65, then the data on the form is from list item number 64 but the attachment is from list item number 65.
I think I will now be able to work out the details for my actual form.
Thanks again!
Tom
For reference, my simple test form to just display a single record from my list with the attachment link is shown below with the ParameterBinding and Attachments field statements highlighted in red. Remember, as it is shown below, if the ID query string parameter does not exist then the form will not show the attachment.
Code Block<%@ Page Language="C#" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="WebPartPages" namespace="Microsoft.SharePoint.WebPartPages" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<html dir="ltr"><head runat="server">
<META name="WebPartPageExpansion" content="full">
<meta name="ProgId" content="SharePoint.WebPartPage.Document">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Scenarios</title>
</head><body>
<form id="form1" runat="server">
<WebPartPages:DataFormWebPart runat="server" IsIncluded="True" FrameType="None" NoDefaultStyle="TRUE" ViewFlag="0" Title="Scenarios" ListName="{31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8}" Default="FALSE" DisplayName="Scenarios" __markuptype="vsattributemarkup" __WebPartId="{CB93A663-9073-4ECB-B4D5-946165BC31AB}" id="g_e2149f48_2575_46aa_907b_7cd91e58cf89" pagesize="1" __AllowXSLTEditing="true" WebPart="true" Height="" Width="">
<DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="<View></View>" id="Scenarios1"><SelectParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8"/><asp:Parameter Name="MaximumRows" DefaultValue="1"/></SelectParameters><DeleteParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8"/></DeleteParameters><UpdateParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8"/></UpdateParameters><InsertParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8"/></InsertParameters></SharePoint:SPDataSource>
</DataSources>
<ParameterBindings>
<ParameterBinding Name="ListItemId" Location="QueryString(ID)" DefaultValue="0"/>
<ParameterBinding Name="ListID" Location="None" DefaultValue="31507A8C-2B4A-414F-8A6F-C7DFB1E9DEE8"/>
<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</ParameterBindings>
<datafields>@Scenario_x0020_ID,Scenario-ID;@SubProcess,SubProcess;@Title,Title;@Priority,Priority;@Description,Description;@Access_x0020_Mode,Access Mode;@Setup_x002d_Initialization,Setup-Initialization;@Expected_x0020_Result,Expected Result;@Predecessors,Predecessors;@Internal_x0020__x0028_to_x0020_P,Internal (to PS) Interfaces;@External_x0020__x0028_to_x0020_P,External (to PS) Interfaces;@External_x0020__x0028_to_x0020_P0,External (to CO) Interfaces;@Related_x0020_TDDs,Related TDDs/FDDs;@Load_x0020_Test_x003f_,Load Test?;@Script_x0020_Reviewed_x0020_by_x0,Scenario - SPOC/SME Approved;@Script_x0020_Assigned_x0020_To,Script - Assigned To;@Script_x0020_Draft_x0020_Complet,Script - Final;@Status_x0020_Notes,Status Notes;@ModuleShortName,Module;@ProcessShortName,Process;@First_x002d_Dash,First-Dot;@Second_x002d_Dash,Second-Dot;@Scenario_x002d_Seq,SEQ;@Custom_x002f_Vanilla,Custom/Vanilla;@Need_x0020_Payroll_x0020_run_x00,Need Payroll run?;@ModuleFinalCombo,ModuleFinal;@Estimated_x0020_Execution_x0020_,Estimated Execution minutes;@Tester,Tester;@ID,ID;@ContentType,Content Type;@Modified,Modified;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;</datafields>
<XSL>
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" 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">'</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">RepForm3</xsl:variable>
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
<xsl:variable name="RowLimit" select="1" />
<xsl:variable name="dvt_RowCount" select="count($Rows)" />
<xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
<table border="0" width="100%">
<xsl:call-template name="dvt_1.body">
<xsl:with-param name="Rows" select="$Rows"/>
<xsl:with-param name="FirstRow" select="1" />
<xsl:with-param name="LastRow" select="$RowLimit" />
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="dvt_1.body">
<xsl:param name="Rows"/>
<xsl:param name="FirstRow" />
<xsl:param name="LastRow" />
<xsl:for-each select="$Rows">
<xsl:variable name="dvt_KeepItemsTogether" select="false()" />
<xsl:variable name="dvt_HideGroupDetail" select="false()" />
<xsl:if test="(position() >= $FirstRow and position() <= $LastRow) or $dvt_KeepItemsTogether">
<xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1">
<xsl:call-template name="dvt_1.rowview" />
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template name="dvt_1.rowview">
<tr>
<td>
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="25%" class="ms-vb">
<b>Scenario-ID:</b>
</td>
<td width="75%" class="ms-vb">
<xsl:value-of select="@Scenario_x0020_ID"/>
</td>
</tr>
<tr>
<td width="25%" class="ms-vb">
<b>Attachments:</b>
</td>
<td width="75%" class="ms-vb">
<SharePoint:AttachmentsField ControlMode="Display" FieldName="Attachments" runat="server" Visible="true"/>
</td>
</tr>
<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
<tr>
<td colspan="99" class="ms-vb">
<span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
</td>
</tr>
</xsl:if>
</table>
</td>
</tr>
</xsl:template></xsl:stylesheet> </XSL>
</WebPartPages:DataFormWebPart>
</form></body>
</html>
-
Monday, December 10, 2007 1:34 PM
Perfect! Thanx a lot!
-
Wednesday, December 12, 2007 10:52 AMHi,
my problem is, that SharePoint drops an error when i insert the
<SharePoint:AttachmentsField ControlMode="Display" FieldName="Attachments" runat="server" Visible="true"/>
tag.
That seems to be very strange because the following namespaces have been registered:
<%@ Page Language="C#" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" masterpagefile="~masterurl/default.master" title="Abteilungsleiter View" meta
rogid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full" %>
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="WebPartPages" namespace="Microsoft.SharePoint.WebPartPages" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Thanks
--Kai -
Friday, January 04, 2008 4:26 AM
Another option to creating a custom form is to add javascript to an existing default form (NewForm, EditForm, etc) to hide, disable and change fields as necessary. I've done it and the delivered functionality for add, display, edit and delete attachments still works just fine. Below is a complete example of the modifications to a NewForm with my javascript highlighted in red.
Code Block<%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
<SharePoint:ListFormPageTitle runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
<SharePoint:ListProperty Property="LinkTitle" runat="server" id="ID_LinkTitle"/>
:
<SharePoint:ListItemProperty id="ID_ItemProperty" MaxLength=40 runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server">
<IMG SRC="/_layouts/images/blank.gif" width=1 height=1 alt="">
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"/>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<table cellpadding=0 cellspacing=0 id="onetIDListForm">
<tr>
<td>
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate>
<WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{0E2E79B5-20D0-47A2-A844-F0C148E24711}" >
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
<Title>Test Problem Report</Title>
<FrameType>Default</FrameType>
<Description />
<IsIncluded>true</IsIncluded>
<PartOrder>1</PartOrder>
<FrameState>Normal</FrameState>
<Height />
<Width />
<AllowRemove>true</AllowRemove>
<AllowZoneChange>true</AllowZoneChange>
<AllowMinimize>true</AllowMinimize>
<AllowConnect>true</AllowConnect>
<AllowEdit>true</AllowEdit>
<AllowHide>true</AllowHide>
<IsVisible>true</IsVisible>
<DetailLink />
<HelpLink />
<HelpMode>Modeless</HelpMode>
<Dir>Default</Dir>
<PartImageSmall />
<MissingAssembly>Cannot import this Web Part.</MissingAssembly>
<PartImageLarge />
<IsIncludedFilter />
<ExportControlledProperties>true</ExportControlledProperties>
<ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
<ID>g_9032c40c_195a_4cb5_b123_e1c4464e86c7</ID>
<ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">{E847BAA9-3000-435C-B36E-85514D76A8A9}</ListName>
<ListItemId xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">0</ListItemId>
<ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">New</ControlMode>
<TemplateName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">ListForm</TemplateName>
<FormType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">8</FormType>
<ViewFlag xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">1048576</ViewFlag>
</WebPart>
</WebPartPages:ListFormWebPart>
</ZoneTemplate></WebPartPages:WebPartZone>
<IMG SRC="/_layouts/images/blank.gif" width=590 height=1 alt="">
</td>
</tr>
</table>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleLeftBorder" runat="server">
<table cellpadding=0 height=100% width=100% cellspacing=0>
<tr><td class="ms-areaseparatorleft"><IMG SRC="/_layouts/images/blank.gif" width=1 height=1 alt=""></td></tr>
</table>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaClass" runat="server">
<script id="onetidPageTitleAreaFrameScript">
document.getElementById("onetidPageTitleAreaFrame").className="ms-areaseparator";
</script>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyAreaClass" runat="server">
<style type="text/css">
.ms-bodyareaframe {
padding: 8px;
border: none;
}
</style>
<script type="text/javascript" language='JavaScript'>
function updateModule()
{
for (var i=0;i<document.forms[0].length;i++)
{
if (document.forms[0].elements[i].title == 'Scenario ID') {
scenarioElemNum = i;
}
if (document.forms[0].elements[i].title == 'Module') {
var parts = document.forms[0].elements[scenarioElemNum].value.split('.');
var itemfound = false;
for (var j=1;j<document.forms[0].elements[i].length;j++)
{
if (parts[0] == document.forms[0].elements[i].options[j].text) {
document.forms[0].elements[i].selectedIndex = j;
itemfound = true;
}
}
if (itemfound == false) {
document.forms[0].elements[i].selectedIndex = 0;
}
}
}
}
</script>
<script type="text/javascript" language='JavaScript'>
function setScenarioOnChange()
{
for (var i=0;i<document.forms[0].length;i++)
{
if (document.forms[0].elements[i].title == 'Scenario ID') {
document.forms[0].elements[i].attachEvent("onchange", updateModule);
break;
}
}
}
</script>
<script type="text/javascript" language='JavaScript'>
function defaultScenarioID()
{
var qs = window.location.search.substring(1);
var ScenarioDefault = '';
if (qs.length > 0) {
qs = qs.replace(/\+/g, ' ');
var args = qs.split('&');
/*alert(qs);*/
for (var i=0;i<args.length;i++) {
var value;
var pair = args[i].split('=');
var name = unescape(pair[0]);
var value = unescape(pair[1]);
if (name == 'Scenario-ID') {
ScenarioDefault = value;
}
}
}
if (ScenarioDefault.length > 0) {
for (var j=0;j<document.forms[0].length;j++)
{
if (document.forms[0].elements[j].title == 'Scenario ID') {
document.forms[0].elements[j].value = ScenarioDefault;
break;
}
}
}
}
</script>
<script type="text/javascript" language='JavaScript'>
function disableFieldByTitle(targetTitle)
{
for (var i=0;i<document.forms[0].length;i++)
{
if (document.forms[0].elements[i].title == targetTitle) {
document.forms[0].elements[i].disabled = true;
break;
}
}
}
</script><script type="text/javascript" language='JavaScript'>
function hideFieldsAfter(targetTitle)
{
for (var i=0;i<document.forms[0].length;i++)
{
if (document.forms[0].elements[i].title == targetTitle) {
targetObj = document.getElementById(document.forms[0].elements[i].id);
tempObj = targetObj.parentNode;
while (tempObj.nodeName != 'TR')
{
tempObj = tempObj.parentNode;
}
trObj = tempObj.nextSibling;
while (trObj.nodeName == 'TR')
{
trObj.style.display = 'none';
trObj = trObj.nextSibling;
}
break;
}
}
}
</script><script type="text/javascript" language='JavaScript'>
setScenarioOnChange();
defaultScenarioID();
updateModule();
disableFieldByTitle('Status');
hideFieldsAfter('Notes');
</script></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyLeftBorder" runat="server">
<div class='ms-areaseparatorleft'><IMG SRC="/_layouts/images/blank.gif" width=8 height=100% alt=""></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleRightMargin" runat="server">
<div class='ms-areaseparatorright'><IMG SRC="/_layouts/images/blank.gif" width=8 height=100% alt=""></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyRightMargin" runat="server">
<div class='ms-areaseparatorright'><IMG SRC="/_layouts/images/blank.gif" width=8 height=100% alt=""></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaSeparator" runat="server"/> -
Tuesday, January 08, 2008 6:48 AM
Bryant, How are you going?
By chance have you had any luck with your request about the file: Microsoft.Exchange.Transporter.Provider.SharePoint.SharePointProvider.xml.smap?
My issue is that I cannot preserve the User Id that created the domino item and modified the domino item. The transporter seems to have trouble converting a Domino Address into a SID for the item to use that in the migration to Sharepoint. As a result it leaves it blank and uses the default value for the user performing the migration. Although I have the conversion in the UserMapping.xml file it seems to ignore it. The transporter adds the mapped user properly to the Site User Lists on the other hand and performs the SID mapping properly in that case.
Have you had this problem? Any suggestions?
Regards
Nate
-
Saturday, January 12, 2008 6:40 PM
There are plenty of posts now for how to display the attachments for a custom single item view.
But, can someone explain how to display attachments for a custom multiple item view?
The parameterbinding statement (ParameterBinding Name="ListItemId" Location="QueryString(ID)" DefaultValue="0") determines for which item the attachments are displayed, so how do you modify the parameterbinding statement in a multiple item view so that the correct attachments are displayed for each item in the view?
- Proposed As Answer by jriesenberg Monday, July 13, 2009 5:19 PM
- Unproposed As Answer by Mike Walsh FINMicrosoft Community Contributor Tuesday, January 05, 2010 7:48 AM
-
Thursday, January 17, 2008 11:16 PM
All I needed to do was hide a few fields that were edited by a workflow in the background. This approach worked perfectly and still allowed the workflow to operate as expected.
Thanks!
Edit: and by "this approach" i mean the solution offered by Sowmya_Ramachandran on page 2. For some reason the quote did not appear.
- Marked As Answer by Mike Walsh FINMicrosoft Community Contributor Tuesday, January 05, 2010 7:48 AM
-
Wednesday, February 13, 2008 5:32 PM
Hmm just came across this problem, I needed to create a 'Custom List Form' through Sharepoint Designer to insert a custom 'submit button', all the button does is redirect the user to another page.
Seems like I can either have redirect or Attach File

-
Saturday, February 16, 2008 8:20 PM
I looked for this solution for several hours before finding this. Can anyone direct me to a source for documentation on all Sharepoint features and attributes such as this?
Thanks.
-
Friday, February 29, 2008 5:51 PM
I Have the same problem, infact the migration kit seems to fail in several attributes and when I try to modify it it seems to ignore changes and I cannot get basic stuff like category to move (with data) to WSS. Is there some additional documentation / guidance how to modify/use xml.smap file? I tried all target mappings and it works differently in all cases.
Still checking things - might even have answer next week ...
Harri
-
Tuesday, March 11, 2008 5:51 PM
Just ran into this wonderful little problem as well. Honestly, I'm extremely irked that creating custom list forms breaks such basic functionality and even more upset by the fact that Microsoft apparently doesn't feel the issue is worth fixing.
One of the core features of SharePoint Designer is using it to customize list forms, yet doing so actually makes your form less useful than the default! How is this acceptable? This sort of thing has become more and more common with MS over the past couple years.
Now, after some playing around I have modified a custom list form page to the point where the attachment button works and I can connect a file. I know the file is getting to the server because I've run packet captures. However, the file never gets saved to the library. I'm guessing there's some event that isn't happening.
MS, please just fix this.
-
Thursday, April 17, 2008 2:33 AM
I have posted an article on my blog that shows the usage of a web part that I built that harnesses SharePoint's template rendering mechanism and allows you to easily customize a display/edit/new form and still retain all of the out-of-the-box SharePoint functionality. You can include or exclude fields explicitly, and also make fields display only. Once it's set up (there's full instructions in the article), no coding is required to customize other forms.
I have posted it here: http://g-m-a-c.blogspot.com/2008/04/customizing-sharepoint-2007-forms.html
I hope this helps...
-
Thursday, April 17, 2008 1:59 PM
Geoff McElhanon wrote: I have posted an article on my blog that shows the usage of a web part that I built that harnesses SharePoint's template rendering mechanism and allows you to easily customize a display/edit/new form and still retain all of the out-of-the-box SharePoint functionality. You can include or exclude fields explicitly, and also make fields display only. Once it's set up (there's full instructions in the article), no coding is required to customize other forms.
I have posted it here: http://g-m-a-c.blogspot.com/2008/04/customizing-sharepoint-2007-forms.html
I hope this helps...
Hi Geoff - I have in fact seen your web part and I do like it!
However, there are times where we need to change more than visibility and or order. One example is on a list form I created with fields for typical shipping address info such as company, address, city, state, zip. I changed the city, state, and zip to display on a single line.
While this is a pretty simple change, it is the sort of thing SPD 2007 is advertised as being capable of. My expectations are that something so straight forward not break a function as basic as attachments.
My guess is we'll have to wait until the next version of the product for this to be addressed and I strongly disapprove of that tactic. Over the past few years this is how MS has started to operate... if somethings broken don't fix it until v.next. Very poor service.
Fix this guys.
-
Friday, April 18, 2008 10:44 PM
Brent,
Based on your example (city/state/zip on a single line), I added a property to my web part to give the ability to override the template that is used for individual fields (I haven't updated the posted source code yet). I have updated the blog post at the bottom with a sample usage of the enhancement, and I think it speaks well to the power of understanding how SharePoints renders it content. I was able to do this in just a few minutes... and, with the exception of the changes I had to make to the web part to support field-level overrides, without any code.
Once again.... http://g-m-a-c.blogspot.com/2008/04/customizing-sharepoint-2007-forms.html
Geoff
-
Tuesday, April 29, 2008 3:59 AMRejoice! A solution to the Attachment problem exists. I've posted the details here: http://cid-6d5649bcab6a7f93.spaces.live.com/blog/cns!6D5649BCAB6A7F93!130.entry
I hope my efforts will help you guys - I've searched all over and there are many people having this problem.
Envoy,
Marc
-
Tuesday, April 29, 2008 8:52 PMIt's a bit of a gnarly solution, to be sure. Just one of the reasons I was so hesitant to post about it on SPD Support's MSDN Blog. I do appreciate the exposure to the public, however. Though, if you guys can just hold on a little longer, we may just see a real fix sooner than later.
-
Tuesday, May 27, 2008 7:10 PM
ahshad wrote: To display attachments that dissapear in a custom display form:
Simply add a new row in the custom display form and add the following line within that row in the code view.
<SharePoint:AttachmentsField ControlMode="Display" FieldName="Attachments" runat="server" Visible="true"/>AWESOME. Solves all problems. Thanks!!
-
Thursday, May 29, 2008 3:54 PManyone had any joy with this solution?
http://cid-6d5649bcab6a7f93.spaces.live.com/blog/cns!6D5649BCAB6A7F93!130.entry -
Thursday, May 29, 2008 3:54 PManyone tried this solution? looks promising!
http://cid-6d5649bcab6a7f93.spaces.live.com/blog/cns!6D5649BCAB6A7F93!130.entry -
Friday, May 30, 2008 9:07 AM
Hi Bill,
Thanks for uploading useful code. But unfortunately i could not fine any changes when i pasted the code into NewForm.aspx. I am new to sharepoint designer, so can you please help me telling where to paste the code and do we need to do any alterations to the code.
Many Thanks
Kranthi
-
Tuesday, June 10, 2008 8:04 PM
I think you forgot to add, before the first for loop, the following line...
Code Snippetvar nb_tables = tables.length - 1;
...otherwise, nb_tables is uninitialized. Once I added this, the code worked fine. To put this in your SharePoint page, edit the page and go to Code view, scroll to the bottom of the page and look for an open "asp:Content" tag (any will do) like this:
Code Snippet<asp:Content ContentPlaceHolderId="PlaceHolderBodyAreaClass" runat="server">
<style type="text/css">
.ms-bodyareaframe {
padding: 8px;
border: none;
}
</style><!-- Paste this code right after this text block (and before the </asp:Content> closing tag): -->
<script language="javascript">
count();
function count(){
var tables = document.getElementsByTagName('table');
var classe = null;
var tableCentrale = null;
var nb_tables = tables.length - 1;
for(var i=0; i < nb_tables; i++){
classe = tables[i].className;
if (classe == 'ms-formtable'){
tableCentrale = tables[i];
}
}
var rows = tableCentrale.rows;
for(var i=8; i <rows.length-1; i++){
rows[i].style.display = 'none';
}
}
</script>Like the original post mentioned, in the second for loop, you need to change ...
Code Snippetvar i = 8
...to the number of fields in your form that you want visible. I have confirmed that this works in MOSS 2007.
-
Wednesday, September 03, 2008 5:02 PM
-
Monday, September 22, 2008 9:16 PM
-
Monday, September 22, 2008 9:17 PM
-
Wednesday, December 03, 2008 5:12 PMHi Rob,
Did the solution worked for you?
For me, I am still stuck with the problem! -
Friday, December 12, 2008 12:08 AMHi
I have done all that there was todo on the microsoft support site on the attachments issue.
http://support.microsoft.com/kb/953271
Everything is working fine except for when I click on okay to save the item and the attachment.
Then I get the following sharepoint error:
"Attachment field cannot be updated."
Does anybody have an idea where I can find the solution.
Regards
Tired, Frustrated - Arno -
Thursday, December 18, 2008 7:14 PMHi AllI have found a solution but that's applicable to Custom Web parts (not SPD)It can be found here :
-
Tuesday, June 30, 2009 7:37 AMHi Arno Filmalter
the link which you have given http://support.microsoft.com/kb/953271 works fine for me.
thanks
but i don't know why the error that occur for you, better you try it again. and read the "NOTE " given in the above said link carefully.
even i had some problems initially, i solved it using the instruction given in that link.- Proposed As Answer by Jegan Ravi Tuesday, June 30, 2009 10:42 AM
- Unproposed As Answer by Mike Walsh FINMicrosoft Community Contributor Tuesday, January 05, 2010 7:49 AM
-
Monday, July 13, 2009 5:14 PMTom - did you ever get an answer for displaying attachments for a custom multiple item view? I am also looking for an answer to the same issue.
Thanks!
Jill- Proposed As Answer by jriesenberg Monday, July 13, 2009 5:19 PM
- Unproposed As Answer by Mike Walsh FINMicrosoft Community Contributor Tuesday, January 05, 2010 7:49 AM
-
Monday, July 13, 2009 5:20 PMTom - persistance has paid off. I found a solution to the problem here, http://www.getsharepoint.com/blogs/bf/Lists/Posts/Post.aspx?ID=19.
Works like a charm!
j -
Monday, January 04, 2010 9:44 PM
Hi,
As Jeganxx noted, http://support.microsoft.com/kb/953271 works just fine.
s
Happy Coding, ~CodeHawk MCSD | MCTS [SharePoint Development] -
Tuesday, February 23, 2010 7:08 AMhi sowmya,
but what if the list is a custom task list? The "allow management of contents" does not display the 3 options (required, optional & hidden).
did you try it for a task list?
regards
prafull -
Tuesday, February 23, 2010 7:35 AM
sorry it works for the task list as well!
But the problem is these coulmns will be invisible for all! That not what I want, for the owners atleast they should be visible. For a contributors they should be invisible.
Do you have answer to it?
regards
prafull- Proposed As Answer by Roy Schalk Friday, March 12, 2010 4:59 PM
-
Friday, March 12, 2010 5:04 PM
I was having a similar issue, When creating the custom form the suggestion was to change the properties of the orignal webpart listform to hidden. The problems seems to come from click the attach file link which tries to put focus on the webpart you've hidden.
Instead of hiding the orignal form I gave mine a targeted audience. I use a group with no members so essentially it wont show for anyone. I placed my cutom form beneath the original form and make my modifications as needed. It appears that my attachments and everything else on the form works correctly.

