I am putting together a form and a toolbar for basic data operations:
Save, New, Delete.

The toolbar is a separate mxml file (tempEmplMaintToolbar). A 
fragment of my form looks like this:
<mx:FormItem>
   <tempEmplMaintToolbar id="toolbar">
   </tempEmplMaintToolbar>
</mx:FormItem>          

The toolbar code (prototype):
<?xml version="1.0" encoding="utf-8"?>
<customToolbar xmlns="modulecode.*" 
xmlns:mx="http://www.adobe.com/2006/mxml"; 
        width="100" height="300">
        <mx:Script>
                <![CDATA[
                        public function saveClick():void
                {
                } 
        ]]>
        </mx:Script>    
        <mx:Button width="16" height="15" id="newbtn" 
                icon="@Embed(source='../assets/newsmall.png')" 
toolTip="New">          
        </mx:Button>
        <mx:Button width="16" height="15" id="savebtn" 
click="saveClick()"
                icon="@Embed(source='../assets/savesmall.png')" 
toolTip="Save">         
        </mx:Button>    
        <mx:Button width="16" height="15" id="deletebtn"
                icon="@Embed(source='../assets/delete.png')" 
toolTip="Delete">               
        </mx:Button>
</customToolbar>

How do I provide a custom code for toolbar's buttons clicks? Or is 
there a better approach for what I am doing?

Thanks

Reply via email to