XAF之 未解決——無法顯示包含nonpersistent對象的ListView

來源:互聯網
上載者:User

        當嘗試在ListView中顯示NonPersistent Obejct時,會報告objectKeyAsString參數為null,顯示一個紅色大叉。

查看輸出如下:

15.05.12 10:50:47.201 ->GetPopupWindowParams
15.05.12 10:50:47.202 Type: DevExpress.ExpressApp.Actions.PopupWindowShowAction
15.05.12 10:50:47.203 ID: b97c96de-e2e9-4132-a5e7-46d384838773
15.05.12 10:50:47.204 Category: Unspecified
15.05.12 10:50:47.205 ContextName: User
15.05.12 10:50:47.206 IsRoot: True
15.05.12 10:50:47.207 Selection.Count: 1
15.05.12 10:50:47.208 CurrentObject: DevExpress.ExpressApp.Security.SecuritySimpleUser(544f6a52-9f48-48e2-bdf0-0b5b6025c63d)
15.05.12 10:50:47.274 --------------------------------------------------------------------------------
15.05.12 10:50:47.275 <- GetPopupWindowParams
15.05.12 10:50:48.389 ================================================================================
The error occurred:


Type:       ArgumentNullException
Message:    值不能為 null。
參數名: objectKeyAsString
Data:       0 entries
Stack trace:

   在 DevExpress.ExpressApp.ObjectHandleHelper.CreateObjectHandle(ITypesInfo typesInfo, Type objectType, String objectKeyAsString)
   在 DevExpress.ExpressApp.ObjectSpace.GetObjectHandle(Object obj)
   在 DevExpress.ExpressApp.Security.MemberOperationPermissionRequest..ctor(Object targetObject, String memberName, String operation)
   在 DevExpress.ExpressApp.DataManipulationRight.HasPermissionTo(Type objectType, String memberName, Object targetObject, CollectionSourceBase collectionSource, String operation)
   在 DevExpress.ExpressApp.DataManipulationRight.CanRead(Type objectType, String propertyName, Object targetObject, CollectionSourceBase collectionSource)
   在 DevExpress.ExpressApp.Win.Editors.GridListEditor.gridView_CustomDrawCell(Object sender, RowCellCustomDrawEventArgs e)
   在 DevExpress.XtraGrid.Views.Grid.GridView.RaiseCustomDrawCell(RowCellCustomDrawEventArgs e)
   在 DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawRowCell(GridViewDrawArgs e, GridCellInfo cell)
   在 DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawRegularRowCell(GridViewDrawArgs e, GridCellInfo ci)
   在 DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawRegularRow(GridViewDrawArgs e, GridDataRowInfo ri)
   在 DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawRow(GridViewDrawArgs e, GridRowInfo ri)
   在 DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawRows(GridViewDrawArgs e)
   在 DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.DrawContents(GridViewDrawArgs e)
   在 DevExpress.XtraGrid.Views.Grid.Drawing.GridPainter.Draw(ViewDrawArgs ee)
   在 DevExpress.XtraGrid.Views.Base.BaseView.Draw(GraphicsCache e)
   在 DevExpress.XtraGrid.GridControl.OnPaint(PaintEventArgs e)
   在 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   在 System.Windows.Forms.Control.WmPaint(Message& m)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)
   在 DevExpress.XtraGrid.GridControl.WndProc(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
InnerException is null

        從上面的輸出可以看到,是XAF的安全機制導致的結果,所以,我嘗試,將工程的安全性原則取消,果然不再報錯。但一個Bussiness Software不可能沒有安全機制,若為了使用Nonpersistent Object而去掉內建的安全機制無疑是挖肉補瘡。

  這是官網上給出的解釋,說明是安全機制的緣故,也印證了我的猜想。目前,只好不在View中顯示NonPersistent Object

後註:已解決,見我下一篇博文。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.