Procedure to Run the Custom Menus Sample
Follow the procedure in this topic to use the custom menus sample to display custom menus and toolbar buttons in a custom WCC application.
Procedure
-
Copy the custom menus samples directory:
StudioHome\wcc\version\samples\CustomMenus\customMenusSample
... to the application root directory:
StudioHome\wcc\version\JSXAPPS\ProjectName\customMenusSample
where:
- StudioHome is the directory in which TIBCO Business Studio was installed.
- version is the version number of Workspace that was installed with TIBCO Business Studio.
- WCCProjectName is the name of the General Interface Builder project that contains your custom application. If you are working with the Workspace application, this is "workspace".
-
In the application’s
config.xml file, add
menu or
toolbar elements under the <record jsxid=”customMenus”> element.
For example, to cause the sample custom menus and toolbar buttons to appear on the work item list, add the following:
<record jsxid="customMenus"> <menu parent="WorkItemList" prototype="customMenusSample/prototypes/menus/MenuSample.xml"></menu> <toolbar parent="WorkItemList" prototype="customMenusSample/prototypes/toolbars/ToolbarSample.xml"></toolbar> </record>
Note that there are example menu and toolbar elements in the application’s config.xml file that you can use or modify to fit your needs. There are additional examples using all of the available parent values in the \samples\CustomMenus\customMenusSample\config.sample.xml file.
- Save and close the application’s config.xml file.
-
Add the desired custom application code to the appropriate event handler.
See sampleToolbarHandler and sampleMenuHandler, which are located in the AppMain.js file in the following directory:
StudioHome\wcc\version\JSXAPPS\WCCProjectName\application\js
where:
- StudioHome is the directory in which TIBCO Business Studio was installed.
- version is the version number of Workspace that was installed with TIBCO Business Studio.
- WCCProjectName is the name of the General Interface Builder project that contains your custom application. If you are working with the Workspace application, this is "workspace".
-
Deploy and run your application.
For information about deploying the application, see Deploying an Application After Customizing.
The provided custom menus sample causes the following menus and buttons to appear on the work item list:
The custom menu selection and toolbar button event will be handled by the event handlers you modified in step 4.
Note: To display custom menus or toolbar buttons, each of the major WCC components that display a list (e.g., work item list, process instance list, etc.) call the loadCustomMenu method. This method displays the custom menu or toolbar button if one is defined in the customMenus parameter in the config.xml file. For more information about the loadCustomMenu method, see the TIBCO Workspace Components Developer’s Guide.