donderdag 2 augustus 2012

Custom Webpart Page with Attachments


What a day, searching for several hours to found out how it come's 
that the attachment functionality didn't work at a custom aspx webpart page.
After searching and searching I found the solution. 
You may not use New/Edit/Display Form directly from your list, but use it via the Custom List Form. 
Otherwise the Attachment functionality will not be provided and I hadn't found
a way to let it functioning. 
So far even that I didn't got an error message anymore and that the attachment 
wasn't saved into your item.

So how to do it... Follow these steps:
 
1.       Create a custom list.

2.       Open that site in SharePoint designer, 
         and create a new web part page in Site Page, 
         then open it in advanced mode.

3.       Then new web part page is opened. 
         Click Insert > New Item Form > Custom List Form > 
         Select that custom list to use for form > 
         Select Item content type to use for form > 
         Select New item form to create > 
         Keeping Show standard toolbar is checked > Click OK.

Then I can get a SharePoint:FormToolBar with Attach File and Spelling options. 
Then save and preview this page, you can see the toolbar in the ribbon is enabled.
Go back to the web part in SharePoint Designer, 
and delete the SharePoint:FormToolBar control, 
save the page and preview it, we can see, 
the toolbar with Save, Cancel, Paste and Attach File buttons is disabled.


 

Geen opmerkingen:

Een reactie posten