Ticket Q443212
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Core - The CompositeView.DelayedItemsInitialization property is ignored in ASP.NET applications

Control DelayedViewItemsInitialization in View Controllers

created 12 years ago

Hello XAF Team,

Is there any drawbacks to control DelayedViewItemsInitialization in view controllers (Win & Web)?

Because I hope to set DelayedViewItemsInitialization to false only in some specific views (keep DelayedViewItemsInitialization as the default 'true' value in most of views).

EDIT: I found the behavior is unstable if I control DelayedViewItemsInitialization's value through view controllers' OnActivated() and OnDeactivated(), at least in Web.

Regards,
James

Answers

created 12 years ago (modified 12 years ago)

Hello,
No, you can customize it for certain Views as well.
We suggest you set the CompositeView.DelayedItemsInitialization property from within the XafApplication.DetailViewCreated event handler.
Setting this property from within a controller is not a good idea, simply because the controller order is undefined and it may be too late to set this property. If you found any issues with the suggested way of setting this property, please let us know.
I hope this helps.
UPDATE:
Be aware of a bug in WebLayoutManager: Core - The CompositeView.DelayedItemsInitialization property is ignored in ASP.NET applications.

    Comments (2)

      I searched 'ItemsInitialization' in XAF source code, and found that WebLayoutManager's behavior was determined by its delayedViewItemsInitialization variable, and the latter always equals to WebApplication.Instance.DelayedViewItemsInitialization. So, I had to use reflection to change that private variable (there is no public setter), and now my problem gets solved.
      ~
      Thanks for your direction!

      Dennis Garavsky (DevExpress) 12 years ago

        James, this is definitely a bug in WebLayoutManager and we will fix it: Core - The CompositeView.DelayedItemsInitialization property is ignored in ASP.NET applications.

        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.