Skip to content
apobekiaris edited this page Jul 28, 2020 · 2 revisions

GitHub issues GitHub close issues

About

With the help of the ViewItemValue XAF modules end-users can configure the default values for lookup view items.

Details


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:

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

kMok40PDFn

image


Possible future improvements:

  1. Multiple default object info persistent with one go.
  2. ListView support.
  3. Remember value strategies e.g Last.
  4. Conditional strategies.
  5. Scripting strategies.
  6. Support for any member type.
  7. Any other need you may have.

Let me know if you want me to implement them for you.


Installation

  1. 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.

  2. Ways to Register a Module or simply add the next call to your module constructor

    RequiredModuleTypes.Add(typeof(Xpand.XAF.Modules.ViewItemValueModule));

Versioning

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.

Dependencies

.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

Issues-Debugging-Troubleshooting

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))

Tests

The module is tested on Azure for each build with these tests. All Tests run as per our Compatibility Matrix

image

image


Custom badge

Star the project if you think it deserves it.

GitHub stars

Fork the project to extend and contribute.

GitHub forks

Clone this wiki locally