Search This Blog

Showing posts with label Actions. Show all posts
Showing posts with label Actions. Show all posts

Wednesday, February 21, 2018

Usability change for SingleChoiceAction with a single visible sub-item - YOUR FEEDBACK IS NEEDED!!!


We have incorporated the usability improvement from my past post in v18.1 by default. It affects SingleChoiceAction with ShowItemsOnlyClick = False and ItemType = ItemIsOperation  and should improve UX for the majority of our users. We also want to enable the same behavior in an upcoming minor update (e.g., v17.2.6 or next). Our team would appreciate your feedback to help us decide on the latter.




Questions/Risks
While this behavior is always desired for the New & Clone Actions, because their meaning is clear from the context, certain custom and built-in Actions like Show In Report, Change State may be affected when they keep only a single sub-item. Examples:

17.2.5 and older versions:




18.1 (and 17.2.6+, if the majority likes it):


Notice that we've replaced a dropdown/triangle glyph with a simple button. We believe that this visual change is still not breaking (and thus is acceptable for a minor version), and it all is more logical than it was before. Before, when ShowItemsOnClick = False, you could still press the SingleChoiceAction's button blindly, i.e., without expanding its items using the triangle glyph. To help you avoid mistakes, the button is now displayed in the ChoiceActionItem's tooltip. You can also control the default Action item behavior using the DefaultItemMode property. If you do not like the new behavior, you can always set ShowItemsOnClick = True in the Model Editor.

Question: Are you OK to have this new behavior as default in v17.2.6+ too? 

Please answer with +1 or -1 with comments in this post. If you need to test your real apps live before making a decision, I can provide you with v17.2 or v18.1 hotfix builds. Thanks for your help in advance.

UPDATE:
Thanks to everyone! With v17.2.6, this behavior is enabled by default.

Wednesday, December 6, 2017

Accessing real persistent objects through the SelectedObjects and CurrentObject properties of View and Action's event arguments when DataAccessMode = DataView or InstantFeedback

The View.CurrentObject and View.SelectedObjects properties return XafDataViewRecord objects instead of original business objects when the View operates in DataView mode (and XafInstantFeedbackRecord - in InstantFeedback mode). To get a real object, you can use the View.ObjectSpace.GetObject(obj) method.

I just wanted to remind you of this specificity and detail currently recommended solution strategies:


According to our current figures for support traffic in this regard (for one year of the InstantFeedback mode existence and more than two years of the DataView mode existence), this is not a big deal for our users - I located less than seven support requests in total. Probably, this is due to the fact that our learning materials already describe this or due to the fact that the DataView and InstantFeedback modes are used rarely, only when ListView contains a lot of records. Here I must also emphasize that this behavior exists in the first place because returning real objects by default may prevent you from getting all the benefits of these data access modes... So, we implemented the current design on purpose.

Should you have difficulties with these features and aforementioned solutions or can foresee better options, my team and I are happy to listen. For instance, one of the alternative solutions I saw in a couple places was the implementation of the auxiliary GetRealSelectedObjects/GetRealCurrentObject methods.

FreeImages.com/Gordon Fortune

Monday, November 27, 2017

How to show Color Swatches for the Bezier skin and persist the user choice in XAF WinForms apps

If you are a fan of the new SVG Bezier skin, our WinForms components received in v17.2, do not miss the XAF integration on the subject:

https://www.devexpress.com/kb=T579152

Both theWinForms and XAF teams are looking forward to hearing from you on this new feature. Learn more about this major release from our What's New documents.


Thursday, July 27, 2017

Survey (~1min): Default location of the Reset View Settings Action - YOUR FEEDBACK IS NEEDED!!!

This command is provided by the standard ResetViewSettingsController and resets all the user customizations of the View's model. It may be helpful when your client customized a lot and was stuck getting things to normal. Due to this scenario the command is available in the main menu toolbar or ribbon by default (+additionally duplicated in context menu in WinForms).



However, we wanted to hear the XAF community thoughts on this default design after receiving several user requests in this regard (examples: onetwo, three). As of now, we have no easy capability to know real usages and customizations of XAF Actions in end client apps, so we would greatly appreciate it if you participate in this and coming surveys. Thanks for your help in advance.

https://dxsurvey.com/published?id=45965fae-dfc7-48ac-af26-aee17d2c3ec4

In fact, we already asked our user preferences when this feature was in development, but did not receive much feedback back then to hide this command from the main menu by default.

Wednesday, July 12, 2017

What happens when the current user is deleted (by himself/herself or another user) while still using the application?

Deletion of the user who is actively using the app is NOT handled by our security module at the moment (e.g., NullReferenceException and other errors may occur). That is mainly because this operation is very rare, and so far we have not received real-life scenarios from our users where this could be useful. Moreover, deleting by accident is already prevented by showing a confirmation message by the standard DeleteObjectsViewController > DeleteAction.

Refer to this Support Center ticket for more considerations and possible custom solutions.


Your feedback is needed!
Even though we do not provide ready solutions for this specific scenario, we will be more than happy to learn more about your experience in this regard to consider improvements to our product for the future. If you needed to handle such scenarios on your own, please elaborate more on your real-life requirements and implemented solutions. Thanks in advance.


FreeImages.Com/Kirill Levin

Tuesday, March 28, 2017

Filtering - How to search objects within ListPropertyEditor or enabling the standard FullTextSearch Action for nested ListView

Just wanted to repost a nice tip from the old SC ticket, which I updated today:

By default, the standard FullTextSearch Action is mapped to the "FullTextSearch" category or Action Container that is physically present in the main, detail and lookup control templates. Historically, it is missing in the nested frame template, which is typically used for ListPropertyEditor, DetailPropertyEditor or DashboardViewItem, mainly not to overload their toolbar with a large text box.

If you still need full text search functionality in nested frame templates, you can consider the following solutions:

1. Create a custom nested frame template as per the Template Customization. article and manually add the "FullTextSearch" action container into it. This solution appears to be the most difficult from the implementation and further maintenance points of view.
2. Customize the default mapping of Actions to the default Action Containers in the Application Model. To do this, invoke the Model Editor and follow this video:


Take special note that It is important to make a copy of the Action definition and place it into the Action Container (e.g., Link), which is NOT present in the main, detail and lookup control templates to avoid duplication of Actions in the UI:


This solutions appears to be the easiest one from all points.

3. Enable native filtering features of the underlying grid, tree and other data bound controls used in nested ListView. For instance, the Find Panel or Auto Filter Row features also provide very good filtering experiences many of your clients will love.  The only disadvantage (which can be noticeable in advanced scenarios only) is that with the standard FullTextSearch Action you can provide common customizations for root and nested ListView using the events and other extensibility points of our FilterController, while for the native control features, you will likely have to implement platform-dependent customizations.

Tuesday, March 7, 2017

How to customize the New Object Action with a single item to display a simple button instead of a dropdown in WinForms


UPDATE:
See the latest post on this matter at Usability change for SingleChoiceAction with a single sub-item - YOUR FEEDBACK IS NEEDED!!!
-----------------------------------------------------------------------
I would like to promote an updated/simplified v16.2 solution for this task after introduction of the ActionBase > CustomizeControl event. To remind you the context, let me quote myself from the https://www.devexpress.com/kb=Q497985 thread:



"XAF allows defining whether a SingleChoiceAction click should show a dropdown or execute an action item immediately using the ShowItemsOnClick and DefaultItemMode  properties. You can easily change these properties based on the number of the New action items. However, a triangle glyph is always shown by default. The SingleChoiceAction does not currently provide built-in means for replacing a dropdown with a simple button either. Currently, to improve user experience with such configurations, you can customize the underlying bar item in the YourSolutionName.Module.Win project.


You can use the following controller to hide a drop-down list from the NewObjectAction in case it contains only one element:


using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.Win.SystemModule;
using DevExpress.XtraBars;
...
namespace YourSolutionName.Module.Win.Controllers {
    public class CustomizeNewActionController : WindowController {
        BarButtonItem newActionBarButtonItem;
        protected override void OnFrameAssigned() {
            base.OnFrameAssigned();
            WinNewObjectViewController newObjectViewController = Frame.GetController<WinNewObjectViewController>();
            SingleChoiceAction newObjectAction = newObjectViewController.NewObjectAction;
            newObjectAction.CustomizeControl += NewObjectAction_CustomizeControl;
            newObjectAction.ItemsChanged += NewObjectAction_ItemsChanged;
        }
        private void NewObjectAction_ItemsChanged(object sender, ItemsChangedEventArgs e) {
            if(newActionBarButtonItem != null) {
                SingleChoiceAction newObjectAction = (SingleChoiceAction)sender;
                int choicesCount = newObjectAction.Items.Count;
                if(choicesCount == 1) {
                    newActionBarButtonItem.ButtonStyle = BarButtonStyle.Default;
                }
            }
        }
        private void NewObjectAction_CustomizeControl(object sender, CustomizeControlEventArgs e) {
            newActionBarButtonItem = e.Control as BarButtonItem;
        }
    }
}




Here are screenshots showing the results in the application UI before and after this customization.


Before


After


Also, you can use the same approach with the CloneObjectAction (it is a part of the CloneObjectViewController). Refer to the following documentation articles to learn more about this solution:
    Concepts > Extend Functionality > Built-in Controllers and Actions 
    Concepts > Extend Functionality > Customize Controllers and Actions 
    Task-Based Help > How to: Customize Action Controls
    DevExpress.XtraBars > BarButtonItem > ButtonStyle 
    DevExpress.XtraBars > BarButtonItem > ActAsDropDown 


For older versions
Check out the How to display a dropdown without a triangle glyph for a SingleChoiceAction ticket for code examples."

Tuesday, November 8, 2016

How to show a specific View at application startup, right after the logon window or after loading the main window

I have recently updated my old KB article with several solutions and wanted to bring this for your information:


Here is the information on typical scenarios to get a better understanding of where this article can be applied: 

"One may want to show a dialog view at startup (after logging in). Typically, this view appears after the successful logon and allows a user to select or edit personal or global settings such as current password, company, currency, language, etc. Also, it may be often required to display this View as modal before a user can access the navigation menu or any other forms in the application. In other scenarios, it may be required to display a kind of notifications popup right after loading the main window, with unread messages, active orders, etc."





As always, it would be great to hear whether you are already using these techniques (specify approach #) in your XAF apps or you had to invent new solutions for a similar task. I am looking forward to hearing from you in the comments.


Thursday, October 13, 2016

How to map Actions to a certain RibbonPage and RibbonGroup via the Application Model

This is my second post about advanced ribbon menu customizations in XAF WinForms apps. This time I want to repost two possible solutions for the aforementioned task after reviewing and updating the code of one good (and never old - Hi, Noxe!:-)) customer recently. This work was done after an interview about my Simplifying customization of Action controls - YOUR FEEDBACK IS NEEDED! post. Take a look at it if you haven't yet. 


Long story short, refer to the https://www.devexpress.com/kb=S134617 ticket and find two possible Controller implementations. Even though the first one (RibbonFromModelWithEventController.cs) requires more code to implement, I like it more, because it does not require you to create an Action Container node manually in the Model Editor. With the first one, you just specify the TargetRibbonPage and TargetRibbonGroup properties for a required Action under the ActionDesign node and you are done:


In any case, I suggest you play with both implementations and watch the attached video to determine what is more suitable for you. I look forward to hearing from you in the comments section or in the Support Center, as always.


I do not want to focus much on the Controller code itself, just want to note that there we extended the standard IModelAction interface corresponding to the ActionDesign | Action node and then handled these new options in our code. This is one of my favorite Application Model features, which is also truly loved by our customers. In fact, everything you see in our framework is built using the same simple principle: you have certain UI metadata or settings store and have some Controllers in modules that create/customize visual controls accordingly. To learn more about this, refer to the Concepts > Application Model > Extend and Customize the Application Model in Code article in our online documentation. This is a really cool feature and it can help you create a more reusable code.

Wednesday, October 5, 2016

How to place all nested View commands into the main ribbon and activate them based on the selected layout tab

My next two posts will be devoted to advanced ribbon menu customizations in WinForms, which become much easier to implement with the introduction of the new Ribbon and Standard templates (WinApplication.UseOldTemplates = False) back in v14.2 and also API changes in the recent XAF versions.

The current post is about mapping ALL Actions from the nested Frame toolbar into the main ribbon menu by creating a separate page. It is planned that when you activate a certain nested ListView within a layout tab, its related View commands will be activated in a separate ribbon page as well (context-dependent commands). This somewhat exotic approach was requested a few times by different customers and is likely dictated by users who have a habit of using only the main ribbon menu, i.e., without moving the mouse to the bottom context.

The two pictures showing how it was before and after making necessary code changes + a video showing everything in action are worth a thousand words in communicating this effect in the real app.
Context-dependent Actions in ribbon

Friday, September 30, 2016

How to find and deactivate a problematic Controller "on the fly" via an application UI for troubleshooting purposes

I wanted to repost a troubleshooting tip our old XAFer and MVP Dave Hesketh has kindly provided in the Support Center today. BTW, Dave also provides XAF training and custom development services, based out of Ontario, Canada, so this may be not the last thing you would want to learn from him and his website

So, let me focus on the problem and solution he described at https://www.devexpress.com/kb=T433881 and also also quickly show it all in action with one of the XAF demos:

"I have come across a few scenarios where something seems to be slowing down an XAF solution and it is tough to determine where the issue exists. This can then lead to hours of tearing out controllers to try and determine if one is problematic.

To make this process easier, I have created a module that you can add to an XAF solution to Enable and Disable controllers on the fly.

Once you add this module to your solution, you will find the "Show Controller Settings" action in the Tools menu. In the dialog that appears, you can enable or disable any controllers you wish, or click the "Disable Custom Controllers" to disable non-DevExpress controllers (A good starting place). 

Please note: Once you enable or disable controllers, you must re-open a view for the change to take effect. 
This solution has been tested on existing Win Applications only."





I remember a couple of similar requests from other guys, and indeed, this dynamic exclusion of Controllers without recompiling and restarting the whole app can be helpful when researching certain complex problems like performance or behavioral/visual side effects. For many other cases, the built-in Diagnostic Actionapplication log files, and performance profilers would suffice pretty well. 

Anyway, let's check how to use Dave's module with our MainDemo.Win app. Consider the following steps:

Thursday, September 15, 2016

Simplifying customization of Action controls - YOUR FEEDBACK IS NEEDED!

As you know, XAF provides abstractions for common UI elements like list and detail forms, their editors, main and navigation menus, etc. that enable XAF developers to accomplish common tasks for several supported platforms with less effort. Today I want to take a moment of your time and focus on popular customization tasks related to Actions - typically abstract UI elements that allow you to perform specific operations in response to end-user manipulations.



For instance, the ActionBase class, which is the super class for all Action types provides many useful members like Caption, ToolTip, Shortcut, PaintStyle, Enabled, Active, etc. that help you care less of technical implementation details for each specific platform or situation, at least for the popular tasks these members were designed for. It is also super easy to manage these properties and events in code or via the visual designers like the Visual Studio component designer for Controller or our own Model Editor.




Current approaches for customizing Action controls

The above looks very well (and many XAFers expressed this is one of the things they love the product for) and we have always been trying to keep this promise when designing our framework:
common and simple tasks can be done easily, while any specific or complex tasks are technically possible

But what about the second part of this promise with regard to Actions in practice? To answer this, it is best to evaluate it yourself for various tasks. Our documentation and support knowledge base contains many code examples for customizing Action controls in various places of an XAF application, and I grouped them below for your review.

Monday, February 29, 2016

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

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 

Monday, August 24, 2015

How to place an Action in a different location programmatically

I think that many people know that they can control this visually by drag&drop under the ActionDesign | ActionToContainerMapping node in the Model Editor, but just a few know of the best code solution. A good scenario when it is necessary to handle this requirement in code is described by our customer in this Support Center ticket (more real user scenarios can be found here).

After receiving enough requests for this, we decided to put a full example solution in our docs. It is based on handling a single CustomizeContainerActions event of the built-in ActionControlsSiteController (or FillActionContainersController class, if your form template does not support the IActionControlsSite  interface).

Do not miss this new online documentation and hopefully, it will help you spend less effort on accomplishing your advanced business requirements in our framework.

Friday, December 26, 2014

A sporadic Visual Studio issue with the incorrect Action constructor after modifying Controller (Finally bypassed in 14.2.4!)

Have you ever seen a situation when your Actions defined in the Controller designer worked well, but one day they disappeared from the application UI and were no event present in the Application Model? Unfortunately, we sometimes did, and so did our customers under certain circumstances. The difficulty of this situation is that this annoying behavior in the IDE was truly random and sporadic, as it all might work on the same machine and then fail without any reason under the same circumstances, with no environment changes. This behavior could be reproducible with both new and existing Controllers and Actions. Our Controller/Action/designers code was fine and the same issue could be reproducible even with the standard Component Designer and standard MS components, so it was eventually reported to MS Connect:



This problem was not massive, to be honest, but the reports the report count reached a reasonable threshold within several years... 

Since we still continue to receive reports from our customers on this behavior from time to time, which negatively affects their experience with our product, we decided to introduce a special "hack" on our side, which helps avoid this behavior. This fix successfully worked in our tests with the problematic virtual machines where we happened to semi-stably isolate this strange behavior. This improvement is available starting with version 14.2.4 and I recommend you upgrade to this version if you experienced this behavior in the past.

Hopefully, you will never experience this again, and Happy XAFing/holidays!