Bug Report Q441908
Visible to All Users

ConditionalAppearance - Layout tabs content may be not fully initialized when using Appearance rules with ViewItemVisibility.Hide on the Web

created 12 years ago

Hello XAF Team,

When using ConditionalAppearance to control visibility of tabs, the show/hide behavior is unstable. Sometimes it works, but sometimes it fails.

Please run the Web project of the attached VS2010 solution (v12.1.7). To learn how to re-produce this issue, please view the .mp4 video (attached in the first comment).

Regards,
James

Show previous comments (5)

    Thanks Konstantin for your suggestions!
    ~
    WebApplication.DelayedViewItemsInitialization is not a good idea, because that will significantly decrease the detail view loading performance (too long when entering the detail view).
    ~
    If the nested list views are not organized via tabs, but are organized in simple groups, then there will be two layout issues in Web: (1) The UI style is not consistent (no Tab header), compared to other tabs-based nested list views; (2) The toolbar's width is larger than the nested list view (grid) itself.
    ~
    So, it's better to resolve the described ConditionalAppearance compatibility issue with DelayedViewItemsInitialization (true) in Web UI.

    Dennis Garavsky (DevExpress) 12 years ago

      Thank you for the feedback, James. We hope you continue discussing the suggested temporary solution in Control DelayedViewItemsInitialization in View Controllers. I am afraid we do not have other workarounds at the moment.

        OK, thank you very much for your suggestions, Dennis. I'll try the workaround you provided in Q443212.

        Answers approved by DevExpress Support

        created 8 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.

        Additional information:

        In the 17.1 version, we have improved the scenario of loading the ASPxPageControl tab content when XafApplication.DelayedViewItemsInitialization equals true and the Conditional Appearance module is involved. So it is possible to revert the DelayedItemsInitialization option to true starting with the 17.1 version. Refer to the Web Layout Manager improvements and important changes in XAF v17.1 KB Article for more details.

          created 12 years ago (modified 8 years ago)

          Hi James,

          By default, tabs' content is loaded on demand when a tab becomes active. This feature is called Delayed View Items Initialization. According to the research we performed, this feature cannot work correctly with Conditional Appearance rules hiding and showing tabs. This issue cannot be fixed without significant changes in our layout generation mechanism.

          To avoid this behavior in the current version, consider one of the following solutions:
          1. Disable delayed loading of DetailView items (tabs in particular) globally in the application by setting the DevExpress.ExpressApp > XafApplication > DelayedViewItemsInitialization  property to False in the YourSolutionName.Web/WebApplication.xx file:

          C#
          namespace MainDemo.Web { public class MainDemoWebApplication : WebApplication { public MainDemoWebApplication() { InitializeComponent(); DelayedViewItemsInitialization = false;//!!! }

          This global option was originally designed to improve the rendering performance for very complex detail forms, so I recommend you use the second solution and disable this option only for DetailView where you are really experiencing the aforementioned behavior.

          2. Set the DevExpress.ExpressApp > CompositeView > DelayedItemsInitialization property for a particular DetailView object in the overridden OnActivated method of a custom ViewController descendant or in the overridden OnDetailViewCreated method of your WebApplication descendant in the YourSolutionName.Web/WebApplication.xx file:

          C#
          namespace MainDemo.Web { public class MainDemoWebApplication : WebApplication { protected override void OnDetailViewCreated(DetailView view) { base.OnDetailViewCreated(view); if(view.ObjectTypeInfo.Type == typeof(Contact)) { view.DelayedItemsInitialization = false; } }

          3. Redesign your DetailView layout to avoid tabs and use layout groups where possible.

          NOTE: if these three solutions are not suitable for performance reasons, it is recommended to profile your problematic Views as described in the How to measure and improve the application's performance article. You are also welcome to send your debuggable project along with your profiling logs so we can see other ways of making your custom app code faster in these use-case scenarios. Thanks.

            Comments (2)

              Thanks Konstantin for your latest information on this ticket. Currently, I had to use reflection to hack a private variable in one of your classes, to made this scenario work. When you implemented a better solution, I'll remove my current workaround from my projects.

              DevExpress Support Team 12 years ago

                Thank you for your feedback, James.

                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.