eXpandFramework / eXpand

DevExpress XAF (eXpressApp) extension framework. ๐—น๐—ถ๐—ป๐—ธ๐—ฒ๐—ฑ๐—ถ๐—ป.๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ.๐—ฐ๐—ผ๐—บ, ๐˜†๐—ผ๐˜‚๐˜๐˜‚๐—ฏ๐—ฒ.๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ.๐—ฐ๐—ผ๐—บ and ๐˜๐˜„๐—ถ๐˜๐˜๐—ฒ๐—ฟ @๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ and or simply ๐—ฆ๐˜๐—ฎ๐—ฟ/๐˜„๐—ฎ๐˜๐—ฐ๐—ต this repository and get notified from ๐—š๐—ถ๐˜๐—›๐˜‚๐—ฏ
http://expand.expandframework.com
Microsoft Public License
222 stars 115 forks source link

Null reference opening first time an complex detailview #640

Closed vimarx closed 4 years ago

vimarx commented 4 years ago

While testing 19.2.402. I found this exception thrown (before the exception occurred but was hidden)

en Xpand.XAF.Modules.ModelMapper.Services.ModelBindingService.BindToModel(IModelNodeDisabled modelNodeDisabled, Object instance) en Xpand.XAF.Modules.ModelMapper.Services.ModelBindingService.BindTo(IModelNodeDisabled modelNode, Object instance) en Xpand.XAF.Modules.ModelMapper.Services.ModelBindingService.BindTo(ValueTuple3 data) en Xpand.XAF.Modules.ModelMapper.Services.ModelBindingService.<>c.<BindLayoutGroupControl>b__5_3(ValueTuple3 tuple) en System.Reactive.Linq.ObservableImpl.Do`1.OnNext._.OnNext(TSource value) en d:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\Observable\Do.cs: lรญnea 38 en System.Reactive.PlatformServices.ExceptionServicesImpl.Rethrow(Exception exception) en d:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\ExceptionServicesImpl.cs: lรญnea 16

I don't know how to get the .pdb for .XAF modules. image

rSeeFip commented 4 years ago

Try to build XAF.Modules byself, their was an Bug and the fix is not in actually released XAF 19.402.0 XAF.Modules. For me it works

apobekiaris commented 4 years ago

I don't know how to get the .pdb for .XAF modules.

https://github.com/eXpandFramework/eXpand/wiki/HowToDebug#from-the-nuget-packages

debugging is enabled as per docs.

consider enable the reactive logger to get more info to what happened before the exception and also posting details of your problem if you do not spent the time to describe your problem how you expect others time?

Try to build XAF.Modules byself, their was an Bug and the fix is not in actually released XAF 19.402.0 XAF.Modules. For me it works

to my knowledge there is nothing in the lab at the moment

apobekiaris commented 4 years ago

for such case one at least want to know what type of maps are enabled? which modules? and if u invest a few minutes to create a sample most probably will help u to resolve it your self but at for sure it will help me to resolve fast.

rSeeFip commented 4 years ago

i can reproduce this issue to on "complexe views" , following some stacks i get

new 9.txt new 10.txt new 11.txt

by businessobjects with itself association and using of Variants View.

When i build an sample it works, but sample not reflect complexity in app

apobekiaris commented 4 years ago

looking at your stacks it looks like a side effect, the Model can never be null. However it throws to a point that u can override. So what happens when

            ModelBindingService.ControlBind.Subscribe(parameter => {
                parameter.Handled=parameter.Model==null
            })

what's the parameter values at this point?

rSeeFip commented 4 years ago

in detail view by child view of self association i get null in model Map image

and thru this objectreference empty new 13.txt error in ViewSiteManager.cs on image

apobekiaris commented 4 years ago

what is the infoname value?

rSeeFip commented 4 years ago

infoname is LayoutConrolGroup image

apobekiaris commented 4 years ago

previously I posted https://github.com/eXpandFramework/eXpand/issues/640#issuecomment-567425195

that code should workaround the problem did you fail to use it?

rSeeFip commented 4 years ago

yes, i fail. but i thinks this depend to my implementation

apobekiaris commented 4 years ago

why does it fail? its a copy paste thing and should work

rSeeFip commented 4 years ago

when i copy it to Bind data the issue still comes

rSeeFip commented 4 years ago

image

apobekiaris commented 4 years ago

no this is wrong, the code i posted should go to your project before the model is created somewhere perphaps in the constructor of your module.

rSeeFip commented 4 years ago

Sorry, I'm feeling like a rookie. yes, of course it works if i call it during initialization.

the detail view now opens without errors

apobekiaris commented 4 years ago

good to hear u just got confused with the deep dive there is luck of oxygen :), I would like to see the different for this view and what the ME displays as the layout, Please try to open as much nodes as possible and post a scrrenshot

apobekiaris commented 4 years ago

post the model diffs for the layout node for this view and the screenshot

rSeeFip commented 4 years ago

image new 9.txt

rSeeFip commented 4 years ago

its too big for screenshot i paste it to file new9

apobekiaris commented 4 years ago

for now I will let the source code throw as it looks like this state is invalid, users can use the workaround safely @vimarx .

apobekiaris commented 4 years ago

can u confirm that without the workaround throws for any detailview that have nodes removed?

apobekiaris commented 4 years ago

i meant group nodes it has to remove the DevExpressXtraLayout_LayoutControlGroup

rSeeFip commented 4 years ago

yes by other view which occurs error they have node image but when i remove your fix and delete this line in xamfl the error still occurs

apobekiaris commented 4 years ago

ok thnks for the input I will research further it looks like we are close to a better solution.

rSeeFip commented 4 years ago

as far i could test your fix not create different errors, it could be used until better solution

Thanks,

vimarx commented 4 years ago

for now I will let the source code throw as it looks like this state is invalid, users can use the workaround safely @vimarx .

it works for me. thanks!

for vb people, I had to implement the solution as ` ModelBindingService.ControlBind.Subscribe(New IobsDummy)

Class IobsDummy
    Implements IObserver(Of Parameter)

    Public Sub OnNext(value As Parameter) Implements IObserver(Of Parameter).OnNext
        value.Handled = value.Model Is Nothing
    End Sub

    Public Sub OnError([error] As Exception) Implements IObserver(Of Parameter).OnError
    End Sub

    Public Sub OnCompleted() Implements IObserver(Of Parameter).OnCompleted
    End Sub
End Class`
Lukas-lab commented 4 years ago

hi i have the same issue as rSeeFlip.

i tried to use the fix. which references i have to add?

Visual Studio can't find parameter.Handled and parameter.Model

CS1660 "Lambdaausdruck" kann nicht in den Typ "IObserver" konvertiert werden, da es kein Delegattyp ist. image

apobekiaris commented 4 years ago

the solution should be already in the latest lab see #659

to apply the work around if you do not want to try the lab build you need

Install-Package System.Reactive
expand commented 4 years ago

Issue is deprioritized as o Assignee found and scheduled for uto-close if not activity in the next 60 days.

expand commented 4 years ago

Closing issue for age. Feel free to reopen it at any time.

.Thank you for your contribution.