多个 ITransformableFilterValue 的问题
我正在尝试过滤 BDC 列表,但我的过滤器返回多个值。过滤 BDC 列表时,它会根据第一项进行过滤,然后忽略其余值。有人遇到过这个问题吗?你是如何解决的?
#region ITransformableFilterValues Members
public bool AllowAllValue
{
get { return true; }
}
public bool AllowEmptyValue
{
get { return true; }
}
public bool AllowMultipleValues
{
get { return true; }
}
public string ParameterName
{
get { return "Ejemplo"; }
}
public ReadOnlyCollection<string> ParameterValues
{
get
{
List<string> regions = new List<string>();
SPListItemCollection coleccion;
using (SPSite site = new SPSite(SPContext.Current.Web.Url))
{
using (SPWeb web = site.OpenWeb())
{
web.AllowUnsafeUpdates = true;
web.Update();
SPList list = web.Lists["Categorias"];
SPQuery query= new SPQuery();
query.Query= "<Where><Contains><FieldRef Name='Tags'/><Value Type='Note'>" + HttpContext.Current.Request.Params.Get(0).ToString() + "</Value></Contains></Where>";
coleccion= list.GetItems(query);//this is the CAML query
debugger.Text = debugger.Text + "Items encontrados:" + coleccion.Count + "<br>" ;
int i=0;
foreach (SPItem item in coleccion)//all the items i want i get them
{
try
{
regions.Add(item["Title"].ToString());
debugger.Text = debugger.Text + item["Title"].ToString() + "<br>";
i++;
}
catch (Exception ex)
{
debugger.Text = debugger.Text + item["Title"] + " Excepcion : values[" + i + "]" ;
i++;
}
}
}
}
ReadOnlyCollection<string> result = new ReadOnlyCollection<string>(regions);//i add the values to the collection to filter
return result;
}
}
[ConnectionProvider("Filtro de ejemplos", "ITransformableFilterValues", AllowsMultipleConnections = true)]
public ITransformableFilterValues SetConnection()
{
return this;
}
#endregion
I'm trying to filter a BDC list and my filter returns multiple values. When the BDC list is filtered it filters based on the first item and then ignores the remaining values. Has anyone run into this and how did you resolve it?
#region ITransformableFilterValues Members
public bool AllowAllValue
{
get { return true; }
}
public bool AllowEmptyValue
{
get { return true; }
}
public bool AllowMultipleValues
{
get { return true; }
}
public string ParameterName
{
get { return "Ejemplo"; }
}
public ReadOnlyCollection<string> ParameterValues
{
get
{
List<string> regions = new List<string>();
SPListItemCollection coleccion;
using (SPSite site = new SPSite(SPContext.Current.Web.Url))
{
using (SPWeb web = site.OpenWeb())
{
web.AllowUnsafeUpdates = true;
web.Update();
SPList list = web.Lists["Categorias"];
SPQuery query= new SPQuery();
query.Query= "<Where><Contains><FieldRef Name='Tags'/><Value Type='Note'>" + HttpContext.Current.Request.Params.Get(0).ToString() + "</Value></Contains></Where>";
coleccion= list.GetItems(query);//this is the CAML query
debugger.Text = debugger.Text + "Items encontrados:" + coleccion.Count + "<br>" ;
int i=0;
foreach (SPItem item in coleccion)//all the items i want i get them
{
try
{
regions.Add(item["Title"].ToString());
debugger.Text = debugger.Text + item["Title"].ToString() + "<br>";
i++;
}
catch (Exception ex)
{
debugger.Text = debugger.Text + item["Title"] + " Excepcion : values[" + i + "]" ;
i++;
}
}
}
}
ReadOnlyCollection<string> result = new ReadOnlyCollection<string>(regions);//i add the values to the collection to filter
return result;
}
}
[ConnectionProvider("Filtro de ejemplos", "ITransformableFilterValues", AllowsMultipleConnections = true)]
public ITransformableFilterValues SetConnection()
{
return this;
}
#endregion
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论