-
-
Notifications
You must be signed in to change notification settings - Fork 41
ViewWizard
With the help of the ViewItemValue XAF modules end-users can configure the default values for lookup view items.
Credits: to the Company (wants anonymity) that sponsor the initial implementation of this module.
This is a platform agnostic
module. The end-user can execute the ViewItemValue
action and select which value a lookup property editor will get when a new object is created. To configure the participating DetailView and lookup members you can use the Model Editor as in the next image:
When the above Order_DetailView
created the ViewItemValue
will be active and will contain two items the Product
and the Accessory
. Executing the action will result in saving the related lookup editor object key value along with the view and member name in the database. When the same Order_DetailView is created later for a new object then the info from the database will be used to assign the appropriate object.
We want the end user to configure the default lookup values for certain views Traditionally: You have to declare tables that hold which value was for which lookup. To configure it you need to extend the model. As always you have to test support and distribute. eXpandFramework solution: Use the cross platform Xpand.XAF.Modules.ViewItemValue
In the screencast we configure the model to allow end user to choose the default values for Product
and Order
when he is on the Order_DetailView
Possible future improvements:
- Multiple default object info persistent with one go.
- ListView support.
- Remember value strategies e.g Last.
- Conditional strategies.
- Scripting strategies.
- Support for any member type.
- Any other need you may have.
Let me know if you want me to implement them for you.
-
First you need the nuget package so issue this command to the
VS Nuget package console
Install-Package Xpand.XAF.Modules.ViewItemValue
.The above only references the dependencies and next steps are mandatory.
-
Ways to Register a Module or simply add the next call to your module constructor
RequiredModuleTypes.Add(typeof(Xpand.XAF.Modules.ViewItemValueModule));
The module is not bound to DevExpress versioning, which means you can use the latest version with your old DevExpress projects Read more.
The module follows the Nuget Version Basics.
.NetFramework: net461
DevExpress.ExpressApp | Any |
DevExpress.Xpo | Any |
Fasterflect.Xpand | 2.0.7 |
JetBrains.Annotations | 2020.1.0 |
System.Interactive | 4.1.1 |
System.Reactive | 4.4.1 |
System.ValueTuple | 4.5.0 |
Xpand.Extensions | 2.202.40 |
Xpand.Extensions.Reactive | 2.202.41 |
Xpand.Extensions.XAF | 2.202.41 |
Xpand.Extensions.XAF.Xpo | 2.202.37 |
Xpand.XAF.Modules.Reactive | 2.202.41 |
Xpand.VersionConverter | 2.202.9 |
To Step in the source code
you need to enable Source Server support
in your Visual Studio/Tools/Options/Debugging/Enable Source Server Support. See also How to boost your DevExpress Debugging Experience.
If the package is installed in a way that you do not have access to uninstall it, then you can unload
it with the next call at the constructor of your module.
Xpand.XAF.Modules.Reactive.ReactiveModuleBase.Unload(typeof(Xpand.XAF.Modules.ViewItemValue.ViewItemValueModule))
The module is tested on Azure for each build with these tests. All Tests run as per our Compatibility Matrix