Deliver superior customer experiences with an AI-driven platform for creating and deploying cognitive chatbots
Deliver Awesome UI with the most complete toolboxes for .NET, Web and Mobile development
Automate UI, load and performance testing for web, desktop and mobile
A complete cloud platform for an app or your entire digital business
Detect and predict anomalies by automating machine learning to achieve higher asset uptime and maximized yield
Automate decision processes with a no-code business rules engine
Optimize data integration with high-performance connectivity
Connect to any cloud or on-premises data source using a standard interface
Build engaging multi-channel web and digital experiences with intuitive web content management
Personalize and optimize the customer experience across digital touchpoints
Build, protect and deploy apps across any platform and mobile device
Rapidly develop, manage and deploy business apps, delivered as SaaS in the cloud
The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
In the previous article we have seen how we can automatically generate commands based on the Views that we add to the Control Panel class. In many scenarios, this feature will fit perfectly with our requirements and it will save us some time.
There are, however, cases when we need to have a better control over the command panels and the commands inside of them. Let us take a look at the built-in Blogs module for an example of such scenario.
On the first image we see the blogs module and its command panels when the module is in “All blogs” mode. On the second image we see the different command panels that are visible when we are in a “Single blog mode” or in other words, when we enter one of the blogs.
Obviously, the command panels change based on some condition (displaying all blogs or single blog). This is achieved by adding command panels and commands manually and in this article we are going to explore this approach.
So the very simple explanation of the CreateStandardCommandPanels method in the example above would go like this:
If the current view is BlogsView or BlogsPermissionsView create a command panel for the all blogs mode and add several commands to it - at the end add the newly created command panel to the list of all command panels which we have received through the list parameter. On the other hand, if the current view is any other view except BlogsView or BlogsPermissionsView create three different command panels, add some commands to them and finally add all three newly created command panels to the list of all command panels we have received through the list parameter.
Having this understanding, we know that before we can add commands, we need to create a command panel. One can create command panel in following manner:
The signatures of the AddCommand methods are rather simple as the following example suggests:
View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.