London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
The Toolbar is a set of buttons, menus, and text with structure and action commands defined in XML. We will describe how to modify toolbar items by using the top menu as an example.
In this example we will add a new item to the "Welcome" menu on top of the page. To do this you will need to create the file "TopMenu.xml" in the ~/Apps/(ModuleName)/Config/View folder.
<?xml version="1.0" encoding="utf-8" ?>
<View xmlns="http://schemas.mediachase.com/ecf/view">
<ListViewUI>
<Toolbar>
<Menu id="CreateMenu" text="\{SharedStrings:Welcome\}">
<add>
<Button id="MyTestButton" text="TestButton" imageUrl="~/Apps/Shell/styles/Images/Shell/exit.gif" commandName="TestCommand"></Button>
</add>
</Menu>
</Toolbar>
<Commands>
<add>
<Command id=" TestCommand">
<CommandType>ClientAction</CommandType>
<ClientScript>alert('test command');ClientScript>
</Command>
</add>
</ListViewUI>
</View>
In this example we will change the "Sign Out" text in the same menu.
<?xml version="1.0" encoding="utf-8" ?>
<View xmlns="http://schemas.mediachase.com/ecf/view">
<ListViewUI>
<Toolbar>
<Menu id="CreateMenu" text="{SharedStrings:Welcome}">
<Button id="SignOutBtn" text="{ShellStrings:Sign_Out}" imageUrl="~/Apps/Shell/styles/Images/Shell/exit.gif" commandName="ECF_Top_SignOut">
<setAttributes text="New SignOut Text"></setAttributes>
</Button>
</Menu>
</Toolbar>
</ListViewUI>
</View>
In this example we will remove the "Sign Out" button in the menu.
<?xml version="1.0" encoding="utf-8" ?>
<View xmlns="http://schemas.mediachase.com/ecf/view">
<ListViewUI>
<Toolbar>
<Menu id="CreateMenu" text="{SharedStrings:Welcome}">
<remove nodeId="SignOutBtn" /
</Menu>
</Toolbar>
</ListViewUI>
</View>
You can add the following elements to the toolbar:
Note that if the XML contains an unsupported element, the exception NotSupportedException will be thrown.
Last updated: May 28, 2015