我要抓住机会在这里问一个问题,因为我真的找不到这个问题的根本原因。
我正在使用 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.
发布评论
评论(1)
DataSourceMode="List"
<SharePoint:SPDataSource runat="server" DataSourceMode="ListItem"
and change the DataSourceMode toDataSourceMode="List"
<ParameterBinding Name="ListItemId".....
and change it to<ParameterBinding Name="ListItemId" Location="None" DefaultValue="0"/>