Retrieve value on server side with Custom Object, ISDataSource and AllowAutoQueryHandler=false

2 replies. Last post: November 6, 2009 8:42 AM by Patrick Chanez
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

I have a webcombo linked to an ISDatasource retrieving data from custom object. When I'm using AllowAutoQueryHandler = true, everything is working fine, but if I set this property to false, the value of the combo and the text is empty ... (everything else ie data retrieval, ... is working fine ... juste the value is not populated during the post)

Do you have an idea ? I'm using the latest version of both components

Here's some extract from the code

<ISDataSource:ISDataSource ID="idsStockOwner" runat="server"
SchemaType="CustomObject">
<Tables>
<ISDataSource:ISDataSourceTable
SelectMethod="SelectWithPaging"
SelectCountMethod="SelectCount"
EnablePaging="True"
TableName="StockOwners"
TypeName="Pmi.ITrack.Web.StockOwnerComboProvider"
>
<SelectParameters>
<asp:ControlParameter Name="additionalSearchFields" ControlID="wcStockOwners" PropertyName="AdditionalSearchFields" ></asp:ControlParameter>
<asp:ControlParameter Name="textField" ControlID="wcStockOwners" PropertyName="DataTextField" ></asp:ControlParameter>
</SelectParameters>
</ISDataSource:ISDataSourceTable>
</Tables>
</ISDataSource:ISDataSource>



<ISWebCombo:WebCombo ID="wcStockOwners" runat="server"
DataMember="StockOwners" DataSourceID="idsStockOwner" Height="20px"
UseDefaultStyle="True" Width="200px" DataTextField="Name"
DataValueField="BusinessEntityId"
AllowAutoQueryHandler="false"
>
</ISWebCombo:WebCombo>


C# part :

[System.ComponentModel.DataObject()]
public class StockOwnerComboProvider : ILoadOnDemandDropDownDataSource<StockOwner>
{
#region ILoadOnDemandDropDownDataSource<StockOwner> Members

public int SelectCount(string queryText, string textField, string additionalSearchFields)
{
return StockOwner.CountStockOwners
(
LogicalOperator.Or,
Pmi.ITrack.Web.ServerControls.DropDownList.DropDownList.BuildSearchCriteriaList(textField, additionalSearchFields, queryText),
false
);
}

[System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Select)]
public List<StockOwner> SelectWithPaging(int maximumRows, int startRowIndex, string queryText, string textField, string additionalSearchFields)
{
if (maximumRows > 0)
{
var ordering = new List<OrderingCriteria>()
{
new OrderingCriteria("Code", OrderingDirection.Ascending),
new OrderingCriteria("Name", OrderingDirection.Ascending)
};

return StockOwner.SearchStockOwners
(
LogicalOperator.Or,
Pmi.ITrack.Web.ServerControls.DropDownList.DropDownList.BuildSearchCriteriaList(textField, additionalSearchFields, queryText),
false,
ordering,
maximumRows,
startRowIndex
).ToList();
}
else
{
return new List<StockOwner>();
}
}

#endregion
}


All times are GMT -5. The time now is 9:46 PM.
Previous Next