MyMaterial.Show: What's New (Automatic Generation of SideBarItem and SideBarSubItem items)
Some major updates to the ABMPage definition have been made to enable our what's new topic above.
After studying the SideBarItem of the navigation bars i figured that I can have MyMaterial.Show generate the Side Menu automatically based on what is specified in each page. So far so good. So this is what I had to do.
1. Added "Side Menu" on the tree for the global side menu for your app. Here you can add your own SideBarItems for your app. These SideBarItems can also be generated automatically when you select "Side Menu" depending on what you set up for each page.
On the page designer properties, added
1. Side Bar Item - if the page will be a child of an item in the sidemenu, select the parent side menu item here. You need to create your SideBarItems first to reference them here.
2. On Side Menu - check this if you want this page to be referenced in the side menu. i.e. when selecting Side Menu on the tree, a SideBarItem or SideBarSubItem will be created automatically.
3. Show Sub Menu - check this if you want this page to have the global SideBarItems and SideBarSubItems shown on it.
4. TabIndex - the order of the page in the SideMenu
5.
Active - sometimes you design a page but you dont want it to be part of the final app. For the pages to be part of the final app, their active property should be checked.
6. Other changes include the renaming of the Components menus to Components 1,2 and 3
7. Also some minor bugs were fixed that were indicated by MyMaterial.Show users.
8. The SideBarItem and SideBarSubItem are currently generated as
static components i.e. I'm not using the ConnectPage method yet, maybe in the future, thus your SideBarItems and SideBarSubItems should have the static property turned on.
To add a side menu item, goto Components 3 > ABMSideBarItem, figure 2 should appear. Type in your properties and can also select the page to navigate to.
Figure 1: The updated treeview with Side Menu..
Figure 2: Definition of the ListView side menu
This is a global definition for the ABMSideBarItem. The return value will be ListView. These usually do not have spaces. The Text to be displayed is List View.
We select an icon name. I have not tested the FontAwesome yet with this. Perhaps you can. We leave the URL blank because we will navigate to an existing page, in this case, the mylist page. We give it a tabindex ie it will appear after the 8th item in the sidebar.
Its Active i.e. generate its source code, static, for now check this. We also indicate whether we want a divider infront of the item and or also at the back and select the theme for the divider. Based on the demo, the divider theme has been blank in the examples for the nav bar. Play around.
Now, lets look at how MyMaterial.Show generates SideBarItems and SideBarSubItems automatically. We need to go back to the page definition for that.
For each of the pages that you want to be linked on the side menu, you need to tell MyMaterial.Show that such a page must be linked to the side menu. Let's look at the figure below.
Figure 3
I also got to play with the TabPane for the first time here too.
Figure 4
As explained above, looking at this example, the myswitch page.
1. We want it to be referenced in the side menu, we checked On Side Menu
2. Because we want this reference to be a SideBarSubItem, we selected the parent SideBarItem, in this case InputComponents. Remember, the SideBarItem InputComponents should be created first.
3. We want the Side Menu to be displayed on this page, so we check this too.
4. We specify the TabIndex, which is the display order in the sidemenu, for this example we left this at zero.
5. The page is active, this we check. Now when all is done, the navigationbar code to be generated for this page will be something like this.
Now you do this for all the pages that you want to be referenced by the SideMenu. After completion, select the "Side Menu" on the tree and wala! Magic happens. Your Side Menu is complete.
In the next posts I will talk about individual Side Menus for your pages. This topic is specific to the Global Side Menu. This is like the demo ABMShared ConnectPage example code.
Please however note, whilst MyMaterial.Show is based on the demo source code, the way that I have designed my ABMShared and Theming functionality is different. Let me explain.
- For MyMaterial.Show, all themes are globally defined in the ABMShared module. I have no intention of creating themes per page just like the ABMaterial demo.
- The NavigationBar in the demo is called with ConnectPage in each page, calling a method in ABMShared. In MyMaterial.Show, you create a NavBar per page individually and you can create global navbar side bar items as explained in this post. The end result is the same.