eXpandFramework / eXpand

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

Collapse / Expand LayoutGroup #689

Closed CWolffIF closed 4 years ago

CWolffIF commented 4 years ago

Hi,

if I have a List/Treeview with a corresponding Detailview (f.e. ICategorized) and I have a collapsible LayoutGroup in the Detailsection I got the Error below.

iXISXRM.Win.exe Error: 0 : 26.03.20 15:24:06.965 ================================================================================ The error occurred:

Type:       NullReferenceException
Message:    Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Data:       0 entries
Stack trace:

bei Xpand.ExpressApp.Win.SystemModule.LayoutControlGroupController.OnGroupExpandChanged(Object sender, LayoutGroupEventArgs e) in D:\a\1\s\Xpand\Xpand.ExpressApp\Xpand.ExpressApp.Win\SystemModule\LayoutControlGroupModelAdapterController.cs:Zeile 23. bei DevExpress.XtraLayout.LayoutControl.DevExpress.XtraLayout.ILayoutControl.RaiseGroupExpandChanged(LayoutGroupEventArgs e) bei DevExpress.XtraLayout.LayoutGroup.set_Expanded(Boolean value) bei DevExpress.ExpressApp.Win.Layout.XafLayoutControlGroup.set_Expanded(Boolean value) bei DevExpress.XtraLayout.Handlers.LayoutGroupHandler.DoInvertGroupExpanded(LayoutGroup group) bei DevExpress.XtraLayout.Handlers.LayoutGroupHandler.ProcessGroupActions(EventType eventType, MouseEventArgs e) bei DevExpress.XtraLayout.Handlers.LayoutGroupHandler.PerformOwnersActions(EventType eventType, MouseEventArgs e) bei DevExpress.XtraLayout.Handlers.BaseLayoutItemHandler.PerformControlActions(EventType eventType, MouseEventArgs e) bei DevExpress.XtraLayout.Handlers.LayoutGroupHandler.PerformControlActions(EventType eventType, MouseEventArgs e) bei DevExpress.XtraLayout.Handlers.LayoutControlHandler.PerformChildHandlerActions(EventType eventType, MouseEventArgs e)

expand commented 4 years ago

We will try to answer all questions that do not require research within 24hr. To prioritize cases that require research we use the following labels in order. For all other issues the posting time is respected.

  1. โค Bronze Sponsor
    1. โค Sponsor
    2. โค Backer
    3. Installation
    4. ShowStopper
    5. Nuget
    6. Contribution
    7. BreakingChange
    8. ReproSample
    9. Deployment
    10. must-have

This case is prioritized.

apobekiaris commented 4 years ago

First apologies for the delay.

So, we are talking again cases similar to your other already addressed #659, #652.

Again this stack provides no info and from #659 we know that problems may occured under certain model configurations https://github.com/eXpandFramework/eXpand/issues/659#issuecomment-575920637

also #652 tells us that things can go wrong when

So please go through those two posts and try to provide a sample that I can repro, my guess is that it shouldn't be hard to create a new solution put a few BO that participate in the detailview that fails add the modeldiffs and register the Xpand modules that u have in your main app

CWolffIF commented 4 years ago

Hi Tolis,

it works on the first opening of the view. The node is there and I can expand/collapse. (see screenshot 'first opening')

First Opening

But if I close the View and open it again the error is shown. If I go to the model I can see that the node is not there anymore. (see screenshot 'second opening')

Second Opening

When I "Reset Difference' the node is there and it works again.

apobekiaris commented 4 years ago

still this info is nto enough to reproduce my resources are limited and cannot try random combinations until i get it. This Project_detaillView looks simple did u tried to add it in a new sample and register the xpandSystemWindowsFormsModule? My guess is that u can reproduce it. do not forget the modedill u have there

CWolffIF commented 4 years ago

Hi Tolis,

here is a sample where you can see that node disapears after using Collapse/Expand (see my post before).

Solution1.zip

The errormessage did not appear, but that might have other reasons, cause the sample is very simple.

apobekiaris commented 4 years ago

Hi,

Your sample was broken at least it does not compile on my side and needs hours to make it work. So I created a new one where I register the ModelMapper as this is the module that does the extension. and extended the model as per docs with this code

        public override void Setup(ApplicationModulesManager moduleManager){
            base.Setup(moduleManager);
            moduleManager.Extend(PredefinedMap.LayoutControlGroup);
        }

as you see in my screen cast it works fine. The attach sample use PackagesReference and not packages.config so there are no hintpath and it for sure will work on your side. Can you try to modify it to repro the problem? Can u aslo provide me a screen cast? Solution24.zip

kEOBlUorxt

CWolffIF commented 4 years ago

Hi Tolis,

Your sample has the same problem. Here is my process in your sample

  1. Start the program
  2. Add an address
  3. Open the Modeleditor at runtime and you see. Everything is OK. First Opening
  4. Close the Modeleditor
  5. Expand and Collapse Item1
  6. Close the Address Detail View
  7. Open the Modeleditor at runtime and you see that LayoutControlGroup is missing. Second Opening
CWolffIF commented 4 years ago

Here is my version of your sample with the Address item in the Navigation and Expand in the item1 LayoutGroup.

Solution24.zip

CWolffIF commented 4 years ago

Hi,

there is a second problem in your sample.

If I try to update the model in VS Solution24.Module I got the error

------- Updating model differences: Project: C:\DevProjects\Solution24\Solution24\Solution24.Module\Solution24.Module.csproj Error: Exception occurs while initializing the 'Solution24.Module.Solution24Module' module: _xtraLayoutAssembly check that ModelMapperModule is added to the RequiredModuleTypes collection Update failed

But in your sample ModelMapperModule is added. public Solution24Module() { InitializeComponent(); BaseObject.OidInitializationMode = OidInitializationMode.AfterConstruction; RequiredModuleTypes.Add(typeof(ModelMapperModule)); }

And I can not open the modeleditor in VS.

If I comment the lines

    //public override void Setup(ApplicationModulesManager moduleManager)
    //{
    //    base.Setup(moduleManager);
    //    moduleManager.Extend(PredefinedMap.LayoutControlGroup);
    //}

everything works.

CWolffIF commented 4 years ago

Here is a Screencast Modeleditor.zip

CWolffIF commented 4 years ago

Here is a Screencast for the SampleSolution24 Sample.zip

apobekiaris commented 4 years ago

thnks yes i see the problem unfortunately this is standard XAF behaviour as the LayoutControl is an extension of the IModelViewLayoutElement when the model gets modified it is removed as an empty element. I need to consult with the XAF model team b4 I attempt a workaround

apobekiaris commented 4 years ago

the problem can be reproduced without the modelmapper as

public interface IModelTest:IModelViewLayoutElement{
        string Test{ get; set; }    
    }
    public interface IModelLayoutElementTest:IModelNode{
        IModelTest Test{ get; }
    }

        public override void ExtendModelInterfaces(ModelInterfaceExtenders extenders){
            base.ExtendModelInterfaces(extenders);
            extenders.Add<IModelLayoutGroup,IModelLayoutElementTest>();
        }

so the real question is how we can extend the IModelLayoutGroup, I hope the XAF team has a answer cause it requires a lot of refactor to follow another not strongly typed path.

CWolffIF commented 4 years ago

Hi Tolis,

is it possible to remove the LayoutControlGroup from the Modelmapper?

apobekiaris commented 4 years ago

why u want to remove it does it make problems if u are not using it?

CWolffIF commented 4 years ago

Yes, I need the Collapse/Expand in my Application. And this Feature is in standard XAF. But if the LayoutControlGroup is missing I got the Error above.

apobekiaris commented 4 years ago

i am looking into it

apobekiaris commented 4 years ago

my understanding is that u refere to

Xpand.ExpressApp.Win.SystemModule.LayoutControlGroupController.OnGroupExpandChanged(Object sender, LayoutGroupEventArgs e) in D:\a\1\s\Xpand\Xpand.ExpressApp\Xpand.ExpressApp.Win\SystemModule\LayoutControlGroupModelAdapterController.cs:Zeile 23.

if so did you tried to disable the LayoutControlGroupModelAdapterController?

public class DisableLayoutControlGroupModelAdapterController:LayoutControlGroupController {
        protected override void OnActivated() {

        }
    }
expand commented 4 years ago

The pre-release 2.201.2.1 in the DevExpress.XAF lab branch includes commits that relate to this task:

Released packages:

  1. Xpand.Extensions v.2.201.13.1
    1. Xpand.Extensions.Mono.Cecil v.2.201.13
    2. Xpand.Extensions.Reactive v.2.201.13.1
    3. Xpand.Extensions.XAF v.2.201.13.2
    4. Xpand.Extensions.XAF.Xpo v.2.201.13
    5. Xpand.XAF.Core.All v.2.201.26.1
    6. Xpand.XAF.Modules.AutoCommit v.2.201.13.2
    7. Xpand.XAF.Modules.CloneMemberValue v.2.201.13.2
    8. Xpand.XAF.Modules.CloneModelView v.2.201.13.2
    9. Xpand.XAF.Modules.GridListEditor v.2.201.13.2
    10. Xpand.XAF.Modules.HideToolBar v.2.201.13.2
    11. Xpand.XAF.Modules.MasterDetail v.2.201.13.2
    12. Xpand.XAF.Modules.ModelMapper v.2.201.13.2
    13. Xpand.XAF.Modules.ModelViewInheritance v.2.201.13.2
    14. Xpand.XAF.Modules.OneView v.2.201.13.2
    15. Xpand.XAF.Modules.ProgressBarViewItem v.2.201.13.2
    16. Xpand.XAF.Modules.Reactive v.2.201.13.2
    17. Xpand.XAF.Modules.Reactive.Logger v.2.201.13.2
    18. Xpand.XAF.Modules.Reactive.Logger.Client.Win v.2.201.13.2
    19. Xpand.XAF.Modules.Reactive.Logger.Hub v.2.201.13.2
    20. Xpand.XAF.Modules.Reactive.Win v.2.201.13.2
    21. Xpand.XAF.Modules.RefreshView v.2.201.13.2
    22. Xpand.XAF.Modules.SuppressConfirmation v.2.201.13.2
    23. Xpand.XAF.Modules.ViewEditMode v.2.201.13.2
    24. Xpand.XAF.Web.All v.2.201.26.1
    25. Xpand.XAF.Win.All v.2.201.26.1

Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.

If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.

Thanks a lot for your contribution.

apobekiaris commented 4 years ago

the LayoutControlGroup confiuration is now moved to image

u can create more contexts if u wish and assign them. The LayoutControlGroupController is removed and there is no two way binding to this feature as it make sense only for the expanding which is already buildin in XAF.

Let me know if it works well for u.

CWolffIF commented 4 years ago

Hi Tolis,

it doesnยดt work.

If I select "(none)" I got the error: iXISXRM.Win.exe Error: 0 : 09.04.20 13:46:46.114 ================================================================================ The error occurred:

Type:       ArgumentNullException
Message:    Der Wert darf nicht NULL sein.

Parametername: source Data: 0 entries Stack trace:

bei System.Linq.Enumerable.Select[TSource,TResult](IEnumerable1 source, Func2 selector) bei Xpand.XAF.Modules.ModelMapper.Services.ModelBindingService.ToBindableData(IModelNode node, ObjectView objectView) in D:\a\1\s\src\Modules\ModelMapper\Services\ModelBindingService.cs:Zeile 151. bei Xpand.XAF.Modules.ModelMapper.Services.ModelBindingService.<>c.b__52(ValueTuple`2 ) in D:\a\1\s\src\Modules\ModelMapper\Services\ModelBindingService.cs:Zeile 89. bei System.Reactive.Linq.ObservableImpl.SelectMany`2.EnumerableSelector._.OnNext(TSource value) in d:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\Observable\SelectMany.cs:Zeile 1328. InnerException is null

And if I select "Default" I got the Error from before: iXISXRM.Win.exe Error: 0 : 09.04.20 13:43:44.670 ================================================================================ The error occurred:

Type:       NullReferenceException
Message:    Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Data:       0 entries
Stack trace:

bei Xpand.ExpressApp.Win.SystemModule.LayoutControlGroupController.OnGroupExpandChanged(Object sender, LayoutGroupEventArgs e) in D:\a\1\s\Xpand\Xpand.ExpressApp\Xpand.ExpressApp.Win\SystemModule\LayoutControlGroupModelAdapterController.cs:Zeile 23. bei DevExpress.XtraLayout.LayoutControl.DevExpress.XtraLayout.ILayoutControl.RaiseGroupExpandChanged(LayoutGroupEventArgs e) bei DevExpress.XtraLayout.LayoutGroup.set_Expanded(Boolean value) bei DevExpress.ExpressApp.Win.Layout.XafLayoutControlGroup.set_Expanded(Boolean value) bei DevExpress.XtraLayout.Handlers.LayoutGroupHandler.DoInvertGroupExpanded(LayoutGroup group) bei DevExpress.XtraLayout.Handlers.LayoutGroupHandler.ProcessGroupActions(EventType eventType, MouseEventArgs e) bei DevExpress.XtraLayout.Handlers.LayoutGroupHandler.PerformOwnersActions(EventType eventType, MouseEventArgs e) bei DevExpress.XtraLayout.Handlers.BaseLayoutItemHandler.PerformControlActions(EventType eventType, MouseEventArgs e) bei DevExpress.XtraLayout.Handlers.LayoutGroupHandler.PerformControlActions(EventType eventType, MouseEventArgs e) bei DevExpress.XtraLayout.Handlers.LayoutControlHandler.PerformChildHandlerActions(EventType eventType, MouseEventArgs e) bei DevExpress.XtraLayout.Handlers.LayoutControlHandler.PerformControlActions(EventType eventType, MouseEventArgs e) bei DevExpress.XtraLayout.Handlers.LayoutControlHandler.OnMouseDown(MouseEventArgs e) bei DevExpress.XtraLayout.Handlers.LayoutControlHandler.OnMouseDown(Object sender, MouseEventArgs e) bei DevExpress.XtraLayout.LayoutControl.OnMouseDown(MouseEventArgs e) bei System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) bei System.Windows.Forms.Control.WndProc(Message& m) bei System.Windows.Forms.ScrollableControl.WndProc(Message& m) bei System.Windows.Forms.ContainerControl.WndProc(Message& m) bei DevExpress.XtraLayout.LayoutControl.WndProc(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) InnerException is null

apobekiaris commented 4 years ago

hmm i will address the None case, however u do not need to explicit set to none if your DEfault context is not modified it will do nothing. It still throw cause Xpand build is not yet published where the LayoutControlGroupController is removed. There will be a notfication again from the bot once the build is released,

expand commented 4 years ago

eXpand.lab release 19.2.700.0 includes commit that relate to this task:

Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.

Thanks a lot for your contribution.

apobekiaris commented 4 years ago

If I try to update the model in VS Solution24.Module I got the error

expected behavior as I added the extension in an agnostic module that knows nothing about the win libs

moduleManager.Extend(PredefinedMap.LayoutControlGroup);
expand commented 4 years ago

Issue is deprioritized as no Assignee found and scheduled for auto-close if no activity in the next 60 days. Thanks a lot for your contribution.

CWolffIF commented 4 years ago

Hi Tolis,

the Installer in 19.2.701.1 went wrong. But u can install the VSIX Package manually.

Installing Assemblies, Nuget, VSIX, Source into C:\Users\CWolff\Documents\eXpandFramework. Additional parameters: Version, Latest, Assets, InstallationPath 19.2.701.1 is a eXpand.lab version Downloading Sources from https://github.com/eXpandFramework/eXpand.lab/releases/download/19.2.701.1/Xpand-Source-19.2.701.1.zip into C:\Users\CWolff\Documents\eXpandFramework Exception calling "DownloadFile" with "2" argument(s): "Der angegebene Host ist unbekannt Der angegebene Host ist unbekannt" At C:\Users\CWolff\Documents\eXpandFramework\InstallXpand.ps1:73 char:9

apobekiaris commented 4 years ago

Hi

I am not sure to what I can relate your post, at least I see no relation to this issue. Please explain

apobekiaris commented 4 years ago

and btw for the installer if it works at least on a clean VM machine you can always consult with the badge found in releases page

Azure DevOps builds

so at least on a VM the installer finished with success and VSIX is installed there.

apobekiaris commented 4 years ago

i also see that i can manually download from https://github.com/eXpandFramework/eXpand.lab/releases/download/19.2.701.1/Xpand-Source-19.2.701.1.zip

in addition I can do it by code

as in the installer lines that fail

https://github.com/eXpandFramework/XpandPwsh/blob/73201dce960499438f19430c5a2ad784baada777/XpandPwsh/Private/Xpand/InstallXpand.ps1#L70-L73

can u retry? and if fails again try to check if the above lines work for u and repost on a new thread if a problem

CWolffIF commented 4 years ago

Hi Tolis,

I tested all with 19.2.701.1 and it works. No more errors. Thanx.

expand commented 4 years ago

The pre-release 2.201.2.2 in the DevExpress.XAF lab branch includes commits that relate to this task:

To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all.

Released packages: 1. [Xpand.XAF.Core.All v.2.201.26.5](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules) 1. [Xpand.XAF.Modules.AutoCommit v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/AutoCommit) 1. [Xpand.XAF.Modules.CloneMemberValue v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/CloneMemberValue) 1. [Xpand.XAF.Modules.CloneModelView v.2.201.13.5](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/CloneModelView) 1. [Xpand.XAF.Modules.GridListEditor v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/GridListEditor) 1. [Xpand.XAF.Modules.HideToolBar v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/HideToolBar) 1. [Xpand.XAF.Modules.LookupCascade v.2.201.2.2](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/LookupCascade) 1. [Xpand.XAF.Modules.MasterDetail v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/MasterDetail) 1. [Xpand.XAF.Modules.ModelMapper v.2.201.13.9](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ModelMapper) 1. [Xpand.XAF.Modules.ModelViewInheritance v.2.201.13.5](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ModelViewInheritance) 1. [Xpand.XAF.Modules.OneView v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/OneView) 1. [Xpand.XAF.Modules.ProgressBarViewItem v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ProgressBarViewItem) 1. [Xpand.XAF.Modules.Reactive v.2.201.13.6](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive) 1. [Xpand.XAF.Modules.Reactive.Logger v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger) 1. [Xpand.XAF.Modules.Reactive.Logger.Client.Win v.2.201.13.7](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger.Client.Win) 1. [Xpand.XAF.Modules.Reactive.Logger.Hub v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger.Hub) 1. [Xpand.XAF.Modules.Reactive.Win v.2.201.13.7](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Win) 1. [Xpand.XAF.Modules.RefreshView v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/RefreshView) 1. [Xpand.XAF.Modules.SuppressConfirmation v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/SuppressConfirmation) 1. [Xpand.XAF.Modules.ViewEditMode v.2.201.13.8](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewEditMode) 1. [Xpand.XAF.Web.All v.2.201.26.5](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules) 1. [Xpand.XAF.Win.All v.2.201.26.5](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules)

Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.

If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.

Thanks a lot for your contribution.