-
-
Notifications
You must be signed in to change notification settings - Fork 42
ViewItemValue
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.
Below is a screencast of the module in action. At the bottom you can see what the Reactive.Logger.Client.Win reports in our dev environment as the module is used in a remote IIS.
Click the screencast to watch it on YouTube.
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.ExpressApp.Validation | Any |
DevExpress.Xpo | Any |
Fasterflect.Xpand | 2.0.7 |
JetBrains.Annotations | 2020.1.0 |
System.Interactive | 4.0.0 |
System.Reactive | 4.3.2 |
System.ValueTuple | 4.5.0 |
Xpand.Extensions | 2.201.34.5 |
Xpand.Extensions.Reactive | 2.201.35.9 |
Xpand.Extensions.XAF | 2.201.35.8 |
Xpand.Extensions.XAF.Xpo | 2.201.33 |
Xpand.XAF.Modules.Reactive | 2.201.35.10 |
Xpand.VersionConverter | 2.201.7 |
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