Ticket T500790
Visible to All Users

[Web] PopupWindowShowAction Listview of persistent objects throws NullReferenceException when selecting row

created 8 years ago (modified 8 years ago)

Hello,

In an application we're developing, we need to link to an external service, which will return a list of Non-Persistent objects (with DomainComponent attribute) the user must choose one from. We're trying to do this through a PopupWindowShowAction, which displays a ListView of the objects. Then, through the DialogController.CloseOnCurrentObjectProcessing property, simply clicking an item will be sufficient.

In WinForms, this solution works well. The object that is clicked will be passed to the PopupWindowShowAction callback in the SelectedObjects list, and it can be used. However, In Web, clicking one of the items results in a NullReferenceException being thrown.

Looking through the stacktrace and debugging into the source, it seems that the non persistent object is not properly registered in the application, however, in Windows this is not posing a problem. I have attempted to use the types subsystem to register the type as well, but this did not change the result.

I hope my description was sufficient. Naturally, if you need any more information I'd be happy to provide it.

Below, you can find the stack trace:

Code
Type: NullReferenceException Message: De objectverwijzing is niet op een exemplaar van een object ingesteld. Data: 0 entries Stack trace: bij DevExpress.ExpressApp.Web.Editors.ComplexWebListEditor.KeyValueEquals(Object val1, Object val2) bij DevExpress.ExpressApp.Web.Editors.ComplexWebListEditor.GetObjectByKey(Object key) bij DevExpress.ExpressApp.Web.Editors.ASPx.ASPxGridViewContextMenu.SelectObject(String objectId) bij DevExpress.ExpressApp.Web.Editors.ASPx.ASPxGridViewContextMenu.ProcessCommand(String args) bij DevExpress.ExpressApp.Web.Editors.ASPx.ASPxGridViewContextMenu.DevExpress.ExpressApp.Web.Templates.IXafCallbackHandler.ProcessAction(String parameter) bij DevExpress.ExpressApp.Web.Templates.XafCallbackManager.ProcessAction(String parameter) bij DevExpress.ExpressApp.Web.Templates.XafCallbackManager.callbackControl_Callback(Object source, CallbackEventArgs e) bij DevExpress.Web.ASPxCallback.OnCallback(CallbackEventArgs e) bij DevExpress.Web.ASPxCallback.RaiseCallbackEvent(String eventArgument) bij DevExpress.Web.ASPxWebControl.System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent(String eventArgument) InnerException is null

Answers

created 8 years ago (modified 8 years ago)

I have managed to fix the issue. The issue turned out to be that the class I was using may have derived from an abstract class with the DomainComponent attribute, but did not have this attribute myself. Because the class I was returning those objects from returned a list of these base objects instead of the implementation, I mistakenly thought it was the base type I was returning, while it was the actual derived type.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.