Skip to main content
A newer version of this page is available. .

Determine Why an Action, Controller or Editor is Inactive

  • 9 minutes to read

When building an application, you may need to determine why an Action or Controller is not active (visible) in a particular Window. An Action may be deactivated or disabled for various reasons: Security System permissions, the current View is read-only, an inconvenient object type of the current View, and other specific parameters. The current View may also be made read-only for different reasons. A thorough debugging may be required to ascertain the actual reason. For this purpose, the eXpressApp Framework provides the Diagnostic Info Action. This Action shows a window with essential information on all Controllers and Actions loaded to the Application Model on the current View, and validation rules applied to the View. This information will assist you with finding issues and fixing them. This topic details how to add the Diagnostic Info Action to your application and use it to get the required information.

Enable the DiagnosticInfo Action

To add the Diagnostic Info Action to the UI, do the following.

  • Open an application project’s configuration file. In the WinForms application project, it is called App.config and in the ASP.NET Web Forms project - Web.config.
  • Locate the appSettings section’s EnableDiagnosticActions key. By default, this key’s value is False. That’s why the Diagnostic Info Action is not added to the Application Model.
  • Set the EnableDiagnosticActions key’s value to True. This will add the Diagnostic Info Action to the Application Model and the Action will be added to the UI.
<add key="EnableDiagnosticActions" value="True" />

The Diagnostic Info Action is implemented in the DevExpress.ExpressApp.SystemModule.DiagnosticInfoController and is contained in the Diagnostic Action Container. The images below demonstrates the Diagnostic Info Action location on various Templates.

WinForms:

DiagnosticInfo_Action

ASP.NET Web Forms:

DiagnosticInfo_Action_Web

The Diagnostic Info Action is a SingleChoiceAction. When clicking this Action’s item, a dialog Window with the DiagnosticInfoObject_DetailView Detail View will be invoked. The DiagnosticInfoObject.AsText property contains information in an XML format.

DiagnosticInfo_Window

Analyze the DiagnosticInfo Action Output

Below are the steps required to determine why an Action is disabled.

  • Determine the identifier of an Action you want to debug. If the Action is implemented in your code, take the ActionBase.Id value. Otherwise, refer to the Determine an Action’s Controller and Identifier topic to see how to get the identifier of a built-in or third-party Action.
  • Click Diagnostic | Actions Info and search for the Action identifier in the output XML.
  • Research the found XML element devoted to the target Action and its Controller. For instance:

    <Controller Name="OpenObjectController" FullName="DevExpress.ExpressApp.Win.SystemModule.OpenObjectController" Active="True">
      <ActiveList>
        <Item Key="View is assigned" Value="True" />
        <Item Key="View type is ObjectView" Value="True" />
        <Item Key="PropertyEditor has ObjectSpace" Value="True" />
      </ActiveList>
      <Actions>
        <Action ID="OpenObject" Caption="Open Related Record" TypeName="SimpleAction" Category="OpenObject" Active="False" Enabled="True" AdditionalInfo="">
          <ActiveList>
            <Item Key="Controller active" Value="True" />
            <Item Key="HasReadPermissionToTargetType" Value="True" />
            <Item Key="DataViewMode" Value="False" />
          </ActiveList>
        </Action>
      </Actions>
    </Controller>
    
  • If the Active or Enabled attributes for the Controller or Action element return “False”, research each individual item under the nested ActiveList and EnabledList elements. The Key attribute of each property shortly describes the reason identifier. A superposition of all Value attributes for these nested items form the resulting Active or Enabled value for the parent Action or its Controller.

DiagnosticInfo Reference

The information presented in the invoked window when the Actions Info item is selected includes the following.

Section

Definition

Template

Specifies the current Window’s context name and Template’s type name.

Template | DefaultActionContainer

Specifies the name of the current Template’s default Action Container (see IFrameTemplate.DefaultContainer).

Template | DefaultActionContainer | Actions

Lists the Actions registered in the default Action Container (see IActionContainer.Actions).

Template | DefaultActionContainer | Actions | Action

Specifies an Action’s ID (see ActionBase.Id).

Template | ActionContainers

Lists the current Template’s Action Containers.

Template | ActionContainers | Container

Specifies an Action Container’s name.

Template | ActionContainers | Container | Actions

Lists the Actions registered in the current Action Container (see IActionContainer.Actions).

Template | ActionContainers | Container | Actions | Action

Specifies an Action’s ID (see ActionBase.Id).

Controllers

Lists all Controllers loaded to the Application Model.

Controllers | Controller

Specifies a Controller’s name and the Active state (see Controller.Active).

Controllers | Controller | ActiveList

Allows you to compare the Controller.Active collection items’ state with the expected state.

Controllers | Controller | ActiveList | Item

Specifies the key and value of an item from the Controller.Active list.

Controllers | Controller | Actions

Lists the Actions contained in the current Controller (see Controller.Actions).

Controllers | Controller | Actions | Action

Specifies the following Action details.

Controllers | Controller | Actions | Action | ActiveList

Allows you to compare the ActionBase.Active collection items’ state with an expected state.

Controllers | Controller | Actions | Action | ActiveList | Item

Specifies the key and value of an item from the ActionBase.Activelist.

Controllers | Controller | Actions | Action | EnabledList

Allows you to compare the ActionBase.Enabled collection items’ state with the expected state.

Controllers | Controller | Actions | Action | EnabledList | Item

Specifies the key and value of an item from the ActionBase.Enabled list.

Controllers | Controller | Actions | Action | Items (for Actions of the SingleChoiceAction type)

Lists items contained in the ChoiceActionItem.Items collection.

Controllers | Controller | Actions | Action | Items | Item (for Actions of the SingleChoiceAction type)

Describes an item: its caption, Active and Enabled states. If the item has a collection of nested items (see ChoiceActionItem.Items), they are also listed and described.

Controllers | Controller | Actions | Action | Items | Item | ActiveList (for Actions of the SingleChoiceAction type)

Allows you to compare the ChoiceActionItem.Active collection items state with the expected state.

Controllers | Controller | Actions | Action | Items | Item | ActiveList | Item (for Actions of the SingleChoiceAction type)

Specifies the key and value of an item from the ChoiceActionItem.Active list.

Controllers | Controller | Actions | Action | Items | Item | EnabledList (for Actions of the SingleChoiceAction type)

Allows you to compare the ChoiceActionItem.Enabled collection items’ state with the expected state.

Controllers | Controller | Actions | Action | Items | Item | EnabledList | Item (for Actions of the SingleChoiceAction type)

Specifies the key and value of an item from the ChoiceActionItem.Enabled list.

The information presented in the invoked window when the View Info item is selected includes the following:

Section

Definition

DetailView

Describes the current View. Writes values of the following properties.

DetailView | AllowNewList

Allows you to compare the View.AllowNew collection items’ state with the expected state.

DetailView | AllowNewList | Item

Specifies the key and value of an item from the View.AllowNew list.

DetailView | AllowEditList

Allows you to compare the View.AllowEdit collection items’ state with the expected state.

DetailView | AllowEditList | Item

Specifies the key and value of an item from the View.AllowEdit list.

DetailView | AllowDeleteList

Allows you to compare the View.AllowDelete collection items’ state with the expected state.

DetailView | AllowDeleteList | Item

Specifies the key and value of an item from the View.AllowDelete list.

DetailView | PropertyEditors

Lists the Property Editors contained in the current View.

DetailView | PropertyEditors | PropertyEditor

Describes a Property Editor:

DetailView | PropertyEditors | PropertyEditor | AllowEditList

Allows you to compare the PropertyEditor.AllowEdit collection items’ state with the expected state.

DetailView | PropertyEditors | PropertyEditor | AllowEditList | Item

Specifies the key and value of an item from the PropertyEditor.AllowEdit list.

ListView

Describes the current List View. Writes values of the following properties:

ListView | AllowNewList

Allows you to compare the View.AllowNew collection items’ state with the expected state.

ListView | AllowNewList | Item

Specifies the key and value of an item from the View.AllowNew list.

ListView | AllowEditList

Allows you to compare the View.AllowEdit collection items’ state with the expected state.

ListView | AllowEditList | Item

Specifies the key and value of an item from the View.AllowEdit list.

ListView | AllowDeleteList

Allows you to compare the View.AllowDelete collection items’ state with an expected state.

ListView | AllowDeleteList | Item

Specifies the key and value of an item from the View.AllowDelete list.

ListView | ListEditor

Describes the current List View’s Editor (see ListEditor). Writes values of the following properties.

The information presented in the window invoked when the Rules Info item is selected includes the following.

Section Definition
Rules Lists all validation rules registered in the Application Model.

Custom Diagnostic Information on Actions

You can supply custom diagnostic information on an Action. To do this, use the ActionBase.DiagnosticInfo property. Its value will be assigned to the AdditionalInfo item within the Controllers | Controller | Actions | Action section. In the following code, the DiagnosticInfo property is specified for the SetPriorityAction from the SetProprityController, which is implemented in the MainDemo (see Add an Action with Option Selection)):

public partial class SetPriorityController : ViewController {
   //...
   private void SetPriorityController_AfterConstruction(object sender, EventArgs e) {
      SetPriorityAction.DiagnosticInfo += "\r\n" + "Hello!";
   }
   // ...
}

The diagnostic info snippet below demonstrates the state of the SetPriorityController and its SetPriorityAction when a Contact is displayed in the main Window.

<Controller Name="SetPriorityController" 
            FullName="MainDemo.Module.SetPriorityController" Active="True">
  <ActiveList>
    <Item Key="View is assigned" Value="True" />
    <Item Key="Activating is allowed" Value="True" />
    <Item Key="!ViewChanging.Cancel" Value="True" />
  </ActiveList>
  <Actions>
    <Action ID="SetPriorityAction" TypeName="SingleChoiceAction" 
         Category="RecordEdit" Active="False" Enabled="True" AdditionalInfo="Hello!">
      <ActiveList>
        <Item Key="EmptyItems" Value="True" />
        <Item Key="Controller active" Value="True" />
        <Item Key="ObjectType" Value="False" />
        <Item Key="HideActionsViewController" Value="True" />
      </ActiveList>
      <EnabledList>
        <Item Key="EmptyItems" Value="True" />
        <Item Key="ByContext_RequireMultipleObjects" Value="True" />
      </EnabledList>
    </Action>
  </Actions>
</Controller>

The SetPriorityAction is activated in the main Window when a Task is displayed and the diagnostic information above confirms that this Action is currently deactivated.