Friday, February 10, 2012
Support » Support Forum
Register Login
HomeWhat is NDO?- Executive Overview- NDO for DevelopersHow NDO Works- Persistent Classes- Mapping- Queries- Reverse Engineering- Inheritance, Polymorphism- Distributed ApplicationsLicensingSupport- Support Forum- FAQ- Solutions- Downloads- E-Mail Support- Tutorial VideosOnline ShopContact
Welcome to the NDO support forum!
Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender. Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts. The forum software requires that javascript is enabled. Please do not insert licence information or licence keys in forum posts. If you know a good answer to a post of another user, feel free to reply! The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.
Hi Marc,
your code snippet doesn't show how you deal with state management in your application. I guess, that you load your object list in the Page_Load event handler. Note, that the object list isn't the same after a postback - it is refetched again. Normally you'd insert an "Edit" Column in your grid, with a link pointing to a page allowing the user to edit one item of the object list. The link to the page is encoded in the ItemDataBound event of the grid as something like that:
http://yoursite/EditItem.aspx?ItemId =33599f8e-eec6-51a0-9d17-ce789fd3e5a9
You'd write something like that:
item.Cells[2].Text = @"<a href=""EditItem.aspx?" + itemId + @""">Insert into shopping basket</a>";
with ItemId being the oid of your item. In the Page_Load event of the EditItem page you just fetch the object using FindObject:
Item i = pm.FindObject(typeof(Item), new Guid(idString));
With that you can bind the edit fields in EditItem.aspx to the properties of the item. In the submit handler you have to refetch the object and enter the values from the edit fields - note that the object doesn't live between the two postbacks, it always has to be read from the database - that's the way how ASP.NET works.
With the enterprise edition of NDO you can serialize an object graph and store it in the session data or pass it along with the request. But that gives you an advantage only with intensive testing and planning.
Regards,Mirko
as to the NDOTypes.xml: It seems, as if the class dsihDataLayer.Person.Address.ddlSalutationLetter is in an inheritance chain. Enable the option Use Polymorphy in the NDO Configuration dialog and enter a type list file name (which must have the name NDOTypes.xml) such, that the file resides in the same directory as your NDOMapping.xml.
as to the update problem: You have to call pm.Save() in the tbxSalutationLetter_TextChanged handler, after setting the SalutationLetter property. You have to use the same pm, as it is used in the dblSalutationLetter.ListAll function. Make the pm available as a static member of a dedicated class.
Best Regards,Mirko