Quantcast
Channel: eXpandFramework RSS
Viewing all articles
Browse latest Browse all 861

A simpler and more atomic control over associated collections using the AllowLink/AllowUnlink commands in the Model Editor

$
0
0
One of our recent team OKRs was and still is "improving developer experience when accomplishing common tasks", and in this blog post, I will cover yet another small, but important improvement in XAF v15.2.4+ that adds to this larger goal.

Let me quote Mark, the owner of the original suggestion in the Support Center, to quickly define the problem:

If you set AllowNew to false, both the link and new buttons are missing
If you set AllowDelete to false, both the delete and unlink buttons are missing.
There are scenarios where it would not be desirable to allow add new or add delete but to still have link and unlink (as those are very independent types of activities).
Proposed SolutionAllow for independent control of the link and unlink buttons.

As a side note, I wanted to note that we seem to have started exploring XAF with Mark almost at the same time in 2007. And from what I gather, he is still using our business application framework for his projects today in 2016, with 12 years of overall DevExpress experience in total! Who has more  "oscars"?;-)  - tell me your years with XAF/DevExpress in comments, please!

Back to the topic, previously there was a way to manage this using a custom ViewController (by managing the ActionBase.Active state), but this was not straightforward for most users. Since there were many other sensible scenarios from users where simplification for these popular commands would be required, we have implemented a simpler and more flexible solution at the Application Model level.

Now, in addition to the AllowNew, AllowEdit and AllowDelete quick options for the ListView node in the Model Editor, you can use the new 




Similarly, the ListView class now provides the two more BoolList type properties:

public BoolList AllowLink { get; }
public BoolList AllowUnlink { get; }

They specify whether the associated objects can be linked and unlinked in the current Nested List View and operate independently from the base AllowNew/AllowDelete options. As a result, you have a more atomic control over what your application does.

And here is the result in the application UI:



I hope you welcome this improvement as other XAFers did. As always, I am open to hear what you think.

See Also:
My earlier post about another usability improvement for nested ListView: 

Viewing all articles
Browse latest Browse all 861

Trending Articles