自定义列表表格以及附件和评级问题
好的,我们在开发包含大量自定义项的 SharePoint 2010 网站时遇到问题。我们在自定义列表上创建了许多自定义列表表单,包括一个新的 NewForm.aspx、一个新的 EditForm.aspx 和一个 DispForm.aspx。
我使用 SharePoint Designer 2010 自定义了这些表单,将新的 DataFormWebPart 添加到页面(保留原始 ListFormWebPart 不变,但隐藏)并自定义 XSLT。
现在,一切都按照我想要的方式进行,但我无法再将附件上传到我的列表项。只有我的 AllItems.aspx 的功能区上仍然有一个可用的附件按钮,在我的所有自定义表单上,它呈灰色显示并显示:“此控件当前已禁用”。
另一个问题,我怀疑是相关的:我已经在列表上启用了开箱即用的评级功能。该字段在我的所有表单上都呈现良好,我可以单击它,然后它显示我已输入评级。但是,当页面重新加载或用户离开到另一个页面时,评级不会保存到列表项中。
我正在使用网站集管理员权限,因此我认为我们可以排除与权限相关的原因。另外,我可以使用 AllItems.aspx 上传附件,因此列表本身很好...也许我由于 DataFormWebParts 而缺少一些基本的 JavaScript?
Ok, we're having a problem while developing a SharePoint 2010 site containing a number of customizations. We've created a number of custom listforms on a custom list, including a new NewForm.aspx, a new EditForm.aspx and a DispForm.aspx.
I've customized these forms using SharePoint Designer 2010, adding a new DataFormWebPart to the page (leaving the original ListFormWebPart intact, but hidden) en customized the XSLT.
Now, everything works like I want it to, but I can no longer upload attachments to my listitems. Only my AllItems.aspx still has a working Attachment-button on the Ribbon, on all my customized forms it's grayed out and says: "This control is currently disabled".
Another problem, which I suspect is related: I've enabled the out-of-the-box Rating functionality on the list. The field renders fine on all my forms and I can click it, after which it shows that I've entered a rating. But, when the page is reloaded or the user leaves for another page, the Rating is not saved to the listitem.
I'm working using site collection administrator permissions, so I think we can exclude a permissions-related cause. Also, I can upload attachments using the AllItems.aspx, so the list itself is fine... Maybe I'm missing some essential JavaScript because of the DataFormWebParts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我们找到了解决这个问题的方法。
根据我的推理,我使用的 DataFormWebParts 与我在 SharePoint 2007 中使用的机制完全相同,而现在拒绝工作的两种机制都是 SharePoint 2010 中的新机制。
因此,我包含了一个-我的 DispForm.aspx 上的标记,并在我的 EditForm 上的 DataFormWebPart 的 XSLT 中创建了一个指向“上传附件”页面的自定义链接。它可能已经过时,但至少现在可以使用...
这意味着用户现在可以上传附件,并且它将显示给浏览列表项的其他用户,但它(显然)远非理想...而且,它还没有'自然地,我的评级字段没有解决问题......
Well, we found a way to work around the problem.
By my reasoning, the DataFormWebParts I used are the exact same mechanism I used to work with in SharePoint 2007, while both the mechanisms that now refuse to work are both new in SharePoint 2010.
So, I included a <SharePoint:AttachmentsField>-tag on my DispForm.aspx and made a custom link to the "Upload Attachment"-page in the XSLT of the DataFormWebPart on my EditForm. It's probably obsolete, but at least it works now...
This means that users can now upload an attachment and it will be shown to other users browsing the listitem, but it's (obviously) far from ideal... Also, it hasn't fixed the problem with my Rating-field, naturally...