Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReference in HideToolBar #433

Open
vimarx opened this issue Jun 10, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@vimarx
Copy link
Member

commented Jun 10, 2019

Describe the bug
While Calling SetView from action for switching editor, I got the following exception

System.InvalidOperationException: Exception occurs while assigning the 'null' view to NestedFrame:
Referencia a objeto no establecida como instancia de un objeto. ---> System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
en Xpand.XAF.Modules.HideToolBar.HideToolBarService.<>c.b__0_2(NestedFrame frame)
en System.Reactive.Linq.ObservableImpl.Where1.Predicate._.OnNext(TSource value) --- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción --- en System.Reactive.PlatformServices.ExceptionServicesImpl.Rethrow(Exception exception) en System.Reactive.Stubs.<>c.b__2_1(Exception ex) en System.Reactive.AnonymousSafeObserver1.OnError(Exception error)
en System.Reactive.Sink1.ForwardOnError(Exception error) en System.Reactive.HalfSerializer.ForwardOnError[T](ISink1 sink, Exception ex, Int32& wip, Exception& error)
en System.Reactive.Linq.ObservableImpl.TakeUntil2._.OnError(Exception ex) en System.Reactive.Sink2.OnError(Exception error)
en System.Reactive.Sink1.ForwardOnError(Exception error) en System.Reactive.Sink2.OnError(Exception error)
en System.Reactive.Sink1.ForwardOnError(Exception error) en System.Reactive.Sink2.OnError(Exception error)
en System.Reactive.Subjects.Subject1.OnError(Exception error) en System.Reactive.Sink1.ForwardOnError(Exception error)
en System.Reactive.Sink2.OnError(Exception error) en System.Reactive.Sink1.ForwardOnError(Exception error)
en System.Reactive.Linq.ObservableImpl.Where1.Predicate._.OnNext(TSource value) en System.Reactive.Sink1.ForwardOnNext(TTarget value)
en System.Reactive.Linq.ObservableImpl.SelectMany2.ObservableSelector._.InnerObserver.OnNext(TResult value) en System.Reactive.Sink1.ForwardOnNext(TTarget value)
en System.Reactive.HalfSerializer.ForwardOnNext[T](ISink1 sink, T item, Int32& wip, Exception& error) en System.Reactive.Linq.ObservableImpl.TakeUntil2..OnNext(TSource value)
en System.Reactive.Sink1.ForwardOnNext(TTarget value) en System.Reactive.Linq.ObservableImpl.Select2.Selector.
.OnNext(TSource value)
en System.Reactive.Subjects.Subject1.OnNext(T value) en System.Reactive.Linq.ObservableImpl.FromEventPattern.Impl2.<>c__DisplayClass3_0.b__1(Object sender, TEventArgs eventArgs)
en System.EventHandler.Invoke(Object sender, EventArgs e)
en DevExpress.ExpressApp.Frame.OnTemplateViewChanged()
en DevExpress.ExpressApp.Frame.SetTemplateView(View view)
en DevExpress.ExpressApp.Frame.SetView(View view, Boolean updateControllers, Frame sourceFrame, Boolean disposeOldView)
--- Fin del seguimiento de la pila de la excepción interna ---
en DevExpress.ExpressApp.Frame.SetView(View view, Boolean updateControllers, Frame sourceFrame, Boolean disposeOldView)
en ClasesBase.SwitchViewController.SimpleAction1_Execute(Object sender, SimpleActionExecuteEventArgs e)
en DevExpress.ExpressApp.Actions.SimpleAction.RaiseExecute(ActionBaseEventArgs eventArgs)
en DevExpress.ExpressApp.Actions.ActionBase.ExecuteCore(Delegate handler, ActionBaseEventArgs eventArgs)
19.1.0607.3
Boolean SetView(DevExpress.ExpressApp.View, Boolean, DevExpress.ExpressApp.Frame, Boolean)
en DevExpress.ExpressApp.Frame.SetView(View view, Boolean updateControllers, Frame sourceFrame, Boolean disposeOldView)
en ClasesBase.SwitchViewController.SimpleAction1_Execute(Object sender, SimpleActionExecuteEventArgs e)
en DevExpress.ExpressApp.Actions.SimpleAction.RaiseExecute(ActionBaseEventArgs eventArgs)
en DevExpress.ExpressApp.Actions.ActionBase.ExecuteCore(Delegate handler, ActionBaseEventArgs eventArgs)

@apobekiaris

This comment has been minimized.

Copy link
Member

commented Jun 10, 2019

While Calling SetView from action for switching editor, I got the following exception

can you post the code that is executed?

@vimarx

This comment has been minimized.

Copy link
Member Author

commented Jun 10, 2019

Private Sub SimpleAction1_Execute(ByVal sender As System.Object, ByVal e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles SwitchViewAction.Execute

    Dim savedView = View
    If View IsNot Nothing AndAlso Frame.SetView(Nothing, True, Nothing, False) Then
        ' Make required changes to the related Application Model nodes here.
        Dim defaultMasterDetailMode As MasterDetailMode = MasterDetailMode.ListViewOnly
        If (CType(savedView.Model, IModelListView)).MasterDetailMode = MasterDetailMode.ListViewAndDetailView Then
            CType(savedView.Model, IModelListView).MasterDetailMode = DevExpress.ExpressApp.MasterDetailMode.ListViewOnly
        Else
            CType(savedView.Model, IModelListView).MasterDetailMode = DevExpress.ExpressApp.MasterDetailMode.ListViewAndDetailView
        End If

        ' Update the saved View according to the latest model changes and assign it to the current Frame.
        savedView.LoadModel(False)
        Frame.SetView(savedView)
        'Optionally update the current object of the inner DetailView.
        'If savedView.EditView IsNot Nothing Then
        '    savedView.EditView.CurrentObject = savedView.CurrentObject
        'End If
    End If

    '   View.SetModel(View.Model)
End Sub
@apobekiaris

This comment has been minimized.

Copy link
Member

commented Jun 10, 2019

are you using the HideToolBar module? can you disabled it as per docs if you are not using it until I fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.