Oct 09, 2009, 2:08 PM
Saving To An ObjectDataSource
Hello again,
I have a ObjectDataSource, which gets connected to a Store into a form. When I try to save the form data, I am getting following error:
Any idea how to get the save to work? It seems like when the store is trying to save the data into ObjectDataSource, it's getting rejected.
Thanks
I have a ObjectDataSource, which gets connected to a Store into a form. When I try to save the form data, I am getting following error:
<style type="text/css">body{border:0;margin:0;padding:3px;height:98%;cursor:text;}</style>System.Exception: Could not find a property named 'RequestsReader' on the type
specified by the DataObjectTypeName property in ObjectDataSource 'TRDataSource'.
---> System.InvalidOperationException: Could not find a property named
'RequestsReader' on the type specified by the DataObjectTypeName property in
ObjectDataSource 'TRDataSource'. at
System.Web.UI.WebControls.ObjectDataSourceView.BuildDataObject(Type
dataObjectType, IDictionary inputParameters) at
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteUpdate(IDictionary keys,
IDictionary values, IDictionary oldValues) at
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values,
IDictionary oldValues, DataSourceViewOperationCallback callback) at
Coolite.Ext.Web.Store.MakeUpdates(IDataSource ds, XmlDocument xml) at
Coolite.Ext.Web.Store.MakeChanges() at Coolite.Ext.Web.Store.DoSaving(String
jsonData, XmlNode callbackParameters) --- End of inner exception stack trace ---
at Coolite.Ext.Web.Store.DoSaving(String jsonData, XmlNode callbackParameters)
at Coolite.Ext.Web.Store.RaiseAjaxPostBackEvent(String eventArgument)
Here's how the code would look like: <asp:ObjectDataSource ID="TRDataSource" runat="server"
DataObjectTypeName="MyFramework.DataClasses.TroubleReportsData"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="MyFramework.DataSources.TroubleReportsDataSource"
DeleteMethod="DeleteItem" InsertMethod="InsertItem"
UpdateMethod="UpdateItem"
onselecting="TRDataSource_Selecting" onupdating="TRDataSource_Updating">
<SelectParameters>
<asp:Parameter Name="criteria" Type="Object" />
</SelectParameters>
</asp:ObjectDataSource>
<ext:store runat="server" ID="CooliteStoreRequests" DataSourceID="TRDataSource"
GroupOnSort="True" AutoDataBind="true" >
<Reader>
<ext:JsonReader ReaderID="RequestsReader" runat="server">
<Fields>
<ext:RecordField Name="TRID"/>
<ext:RecordField Name="System"/>
<ext:RecordField Name="DescriptionSummary"/>
<ext:RecordField Name="Priority"/>
<ext:RecordField Name="DateSubmitted"/>
<ext:RecordField Name="Submitter"/>
<ext:RecordField Name="Phase"/>
<ext:RecordField Name="Description"/>
<ext:RecordField Name="AssignedTo"/>
</Fields>
</ext:JsonReader>
</Reader>
<Listeners>
<load handler=#{TRForm}.loadData(this.getAt(0));" />
</Listeners>
</ext:store>
<ext:FormPanel FormID="TRForm" ID="TRPanel" runat="server" Title="TR Details"
Width="300" StoreID="CooliteStoreRequests">
<Body>
<ext:formlayout runat="server" StoreID="CooliteStoreRequests" ID="FormLayOutTR" labelAlign="left">
<ext:Anchor><ext:TextField runat="server" FieldLabel="TRID" ID="txtTRID" DataIndex="TRID" Disabled="true" Cls="x-item-disabled"/></ext:Anchor>
<ext:Anchor Horizontal="98%"><ext:TextField runat="server" FieldLabel="System" DataIndex="System" ID="txtSystem"/></ext:Anchor>
<ext:Anchor Horizontal="98%"><ext:TextField runat="server" FieldLabel="Description Summary" DataIndex="DescriptionSummary" ID="txtDescriptionSummary"/></ext:Anchor>
<ext:Anchor Horizontal="98%"><ext:TextField runat="server" FieldLabel="Priority" DataIndex="Priority" ID="txtPriority"/></ext:Anchor>
<ext:Anchor Horizontal="98%"><ext:TextField runat="server" FieldLabel="Submitter" DataIndex="Submitter" ID="txtSubmitter"/></ext:Anchor>
</ext:formlayout>
</Body>
<Buttons>
<ext:Button runat="server" Text="Save">
<Listeners>
<Click Handler='function()
{
#{TroubleReportsPanel}.getForm().updateRecord(#{CooliteStoreRequests}.getAt(0));
#{CooliteStoreRequests}.save();
}
}' />
</Listeners>
</ext:Button>
</Buttons>
</ext:FormPanel>
I have tested the ObjectDataSource with .Net and it does save/update proper with ASP.Net version.Any idea how to get the save to work? It seems like when the store is trying to save the data into ObjectDataSource, it's getting rejected.
Thanks