无法在自定义列表表单(新项目)上显示 Web 部件错误

发布于 2024-12-17 11:23:18 字数 2596 浏览 4 评论 0 原文

我要抓住机会在这里问一个问题,因为我真的找不到这个问题的根本原因。

我正在使用 SPD 2007 开发 WSS 3.0 站点,而且我对 Sharepoint 开发总体来说还很陌生。

我正在自定义 DispForm.aspx 页面。该页面是一个简单的编辑页面,但最后,我添加了一个自定义列表表单 Web 部件,用于添加评论(存储在另一个列表中),下面是一个数据视图,用于查看与 DispForm.aspx 显示的项目关联的评论页。

我想要做的类似于此页面上显示的功能,我从中得到启发,实际上您可以将我的评论视为最新评论: http://sharepoint.microsoft.com/blogs/GetThePoint /Lists/Posts/Post.aspx?ID=209

一切正常,直到我删除了作为测试所做的所有评论。现在我从自定义列表表单中得到的只是“无法显示此 Web 部件错误”。

我查看了日志,我明白它在抱怨什么,但我不知道如何修复它,甚至不明白为什么会出现这样的错误。

SPDataSourceView.ExecuteSelect() - selectArguments: IsEmpty=True, MaximumRows=0, RetrieveTotalRowCount=False, SortExpression=, StartRowIndex=0, TotalRowCount=-1
Error while executing web part: System.InvalidOperationException: Unable to open the specified list item. ---> 
System.ArgumentException: **Value does not fall within the expected range**.     
at Microsoft.SharePoint.SPList.**GetItemById**(Int32 id, String strRootFolder, Boolean cacheRowsetAndId)     
at Microsoft.SharePoint.SPList.GetItemById(Int32 id)     
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments)     --- End of inner exception stack trace ---     
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments)     
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)     
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigatorInternal()     
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator()     
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator(IDataSource datasource, Boolean originalData)     
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXPathNavigator(String viewPath)     
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform()
InnerException 1: System.ArgumentException: Value does not fall within the expected range.     
at Microsoft.SharePoint.SPList.GetItemById(Int32 id, String strRootFolder, Boolean cacheRowsetAndId)     
at Microsoft.SharePoint.SPList.GetItemById(Int32 id)     
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments)

我们正在谈论“新项目”表单,所以我不明白为什么我在 GetItemById 上收到错误。它想要得到什么以及如何解决它?

最后,我没有更改 SPD 创建的 CAML 查询。我确实对评论列表进行了更改,例如重命名或删除未使用的列,但我不认为这是问题的原因,因为删除自定义列表表单并重新创建它并没有解决问题。

关于我应该在哪里或什么内容查看的任何线索?我没有什么想法。

谢谢。

I'm gonna take my chance at asking a question here because I really cannot find the root cause of this problem.

I'm working on a WSS 3.0 site, using SPD 2007 and I'm fairly new to Sharepoint development in general.

I'm customizing the DispForm.aspx page. The page is a simple edit page but at the end, I add a custom list form web part for adding comments (which are stored in another list) and below, a dataview for viewing the comments associated to the item displayed by the DispForm.aspx page.

What i want to do resembles the functionality displayed on this page, I inspired myself from it and you can in fact see my comments as the latest one :
http://sharepoint.microsoft.com/blogs/GetThePoint/Lists/Posts/Post.aspx?ID=209

Everything was working, until I delete all the comments i had made as a test. Now all i get from my Custom List Form is this "unable to display this web part error".

I've had a look at the logs, I understand what it is complaining about but i have no clue on how to fix it or even understand why there is such an error to begin with.

SPDataSourceView.ExecuteSelect() - selectArguments: IsEmpty=True, MaximumRows=0, RetrieveTotalRowCount=False, SortExpression=, StartRowIndex=0, TotalRowCount=-1
Error while executing web part: System.InvalidOperationException: Unable to open the specified list item. ---> 
System.ArgumentException: **Value does not fall within the expected range**.     
at Microsoft.SharePoint.SPList.**GetItemById**(Int32 id, String strRootFolder, Boolean cacheRowsetAndId)     
at Microsoft.SharePoint.SPList.GetItemById(Int32 id)     
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments)     --- End of inner exception stack trace ---     
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments)     
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)     
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigatorInternal()     
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator()     
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator(IDataSource datasource, Boolean originalData)     
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXPathNavigator(String viewPath)     
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform()
InnerException 1: System.ArgumentException: Value does not fall within the expected range.     
at Microsoft.SharePoint.SPList.GetItemById(Int32 id, String strRootFolder, Boolean cacheRowsetAndId)     
at Microsoft.SharePoint.SPList.GetItemById(Int32 id)     
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments)

we're talking about a "new item" form, so i don't understand why I'm getting an error on GetItemById. What is it trying to get and how do i fix it?

Finally, I haven't changed the CAML query created by SPD. I did make change to the Comments list such as renaming or deleting unused columns but i don't think it is the cause of the problem because deleting the custom list form and recreating it didn't fix the issue.

Any clues as to where or what I should be looking at? I'm fresh out of ideas.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

二货你真萌 2024-12-24 11:23:18
  1. 在 Sharepoint Designer 中,打开已插入“评论”自定义列表表单的 DispForm。
  2. 在代码视图中,找到列表的 DataFormWebPart。
  3. 找到行 并将 DataSourceMode 更改为 DataSourceMode="List"
  4. 内在 ParameterBindings 中,找到 并将其更改为
  1. In Sharepoint Designer, Open the DispForm that you inserted the "Comments" custom list form into.
  2. In Code view, find the DataFormWebPart for the list.
  3. Locate the line <SharePoint:SPDataSource runat="server" DataSourceMode="ListItem" and change the DataSourceMode to DataSourceMode="List"
  4. Inside of the ParameterBindings, find <ParameterBinding Name="ListItemId"..... and change it to <ParameterBinding Name="ListItemId" Location="None" DefaultValue="0"/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文