Bug Report T298527
Visible to All Users

UI.Web - StateMachineController creates duplicated action buttons when View.ViewEditMode is set to Edit on controller activation

created 9 years ago

I have enabled single-click Edit from my web listview on an object that also has the State Machine enabled using the following in a ViewController<ListView>.

C#
ListViewProcessCurrentObjectController controller = Frame.GetController<ListViewProcessCurrentObjectController>(); if (controller != null) { if (BlackList.Contains(View.Id) == true || Frame.Template is ILookupPopupFrameTemplate) { // Disable the single click edit. controller.ProcessCurrentObjectAction.Enabled[EnabledKeyShowDetailView] = false; } else { controller.ProcessCurrentObjectAction.Enabled[EnabledKeyShowDetailView] = true; } }

However, when the web detail view is displayed with the state machine buttons, it displays both Active and Inactive state machine transition buttons (see attached).  If I simply show another detail view from a nested listview or click the validate action, the state machine buttons are rendered correctly.

Show previous comments (1)
BB BB
Brian Butterfield 9 years ago

    Michael,
    I found the culprit, but I am not sure how to address it.  I failed to provide part of my code which involves forcing the detail view to Edit using the following controller.
    public class SwitchToEditModeDetailViewController : ViewController<DetailView>
       {
           protected override void OnActivated()
           {
               base.OnActivated();
               if (View.ViewEditMode == ViewEditMode.View)
               {
                   View.ViewEditMode = ViewEditMode.Edit;
               }
           }
       }
    If you add this to your solution, it will demonstrate the problem.  The idea is to simply single-click a list view row and display detail view in Edit mode.
    Thoughts?
    Thanks,
    Brian

    DevExpress Support Team 9 years ago

      Thank you for the clarification. I have reproduced the issue. We need additional time to research it. We will inform you once a solution is found. Currently, you can hide action buttons by returning False from the ExpandActionsInDetailView property of your state machine and use the single choice action, available in the toolbar, to change the state.

      BB BB
      Brian Butterfield 9 years ago

        Michael,
        Understood.  In the meantime, I have removed the setting of the ViewEditMode and forced user to click the Edit button on the row.  Please keep me posted.

        Answers approved by DevExpress Support

        created 9 years ago (modified 9 years ago)

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.